Skip to content

Commit 3020c44

Browse files
authored
update with-turbopack example for postcss/tailwind support (#44261)
1 parent 0572e21 commit 3020c44

File tree

4 files changed

+9
-21
lines changed

4 files changed

+9
-21
lines changed

examples/with-turbopack/README.md

+1-15
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,7 @@ This playground is a mirror of the [Next.js v13 App Directory Playground](https:
1111
1. Install dependencies: `yarn`
1212
1. Start the dev server: `yarn dev`
1313

14-
**Note:** The playground uses [Tailwind CSS](https://tailwindcss.com). However, Turbopack does not yet support fully [PostCSS](https://turbo.build/pack/docs/features/css#postcss), but it does support CSS and CSS Modules. [As a workaround](https://turbo.build/pack/docs/features/css#tailwind-css), we run Tailwind through it's CLI upon `postinstall`. For live reload of CSS, you can run Tailwind in another process with the `--watch` flag or install `concurrently` and modify your `dev` script:
15-
16-
```bash
17-
yarn add concurrently --dev
18-
```
19-
20-
Then modify your `dev` script in `package.json`:
21-
22-
```json
23-
{
24-
"scripts": {
25-
"dev": "concurrently \"next dev --turbo\" \"npm run tailwind --watch\""
26-
}
27-
}
28-
```
14+
**Note:** The playground uses [Tailwind CSS](https://tailwindcss.com) via [PostCSS](https://turbo.build/pack/docs/features/css#postcss).
2915

3016
For more information, see: https://turbo.build/pack/docs/features/css#tailwind-css
3117

examples/with-turbopack/app/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '@/styles/dist.css';
1+
import '@/styles/globals.css';
22
import React from 'react';
33
import AddressBar from '@/ui/AddressBar';
44
import GlobalNav from './GlobalNav';

examples/with-turbopack/package.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
"private": true,
33
"scripts": {
44
"dev": "next dev --turbo",
5-
"dev:tailwind": "concurrently \"next dev --turbo\" \"npm run tailwind -- --watch\"",
65
"build": "next build",
76
"start": "next start",
87
"lint": "next lint",
9-
"tailwind": "tailwindcss -i styles/globals.css -o styles/dist.css",
10-
"format": "prettier --write \"**/*.{js,ts,tsx,md}\"",
11-
"postinstall": "npm run tailwind"
8+
"format": "prettier --write \"**/*.{js,ts,tsx,md}\""
129
},
1310
"prettier": {
1411
"arrowParens": "always",
@@ -18,7 +15,6 @@
1815
},
1916
"dependencies": {
2017
"clsx": "1.2.1",
21-
"concurrently": "7.5.0",
2218
"next": "latest",
2319
"react": "18.2.0",
2420
"react-dom": "18.2.0",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};

0 commit comments

Comments
 (0)