Skip to content

Commit 3020c44

Browse files
authored
update with-turbopack example for postcss/tailwind support (vercel#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

Lines changed: 1 addition & 15 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 5 deletions
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",
Lines changed: 6 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy