Unverified Commit 3020c44d authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

update with-turbopack example for postcss/tailwind support (#44261)

parent 0572e218
...@@ -11,21 +11,7 @@ This playground is a mirror of the [Next.js v13 App Directory Playground](https: ...@@ -11,21 +11,7 @@ This playground is a mirror of the [Next.js v13 App Directory Playground](https:
1. Install dependencies: `yarn` 1. Install dependencies: `yarn`
1. Start the dev server: `yarn dev` 1. Start the dev server: `yarn dev`
**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: **Note:** The playground uses [Tailwind CSS](https://tailwindcss.com) via [PostCSS](https://turbo.build/pack/docs/features/css#postcss).
```bash
yarn add concurrently --dev
```
Then modify your `dev` script in `package.json`:
```json
{
"scripts": {
"dev": "concurrently \"next dev --turbo\" \"npm run tailwind --watch\""
}
}
```
For more information, see: https://turbo.build/pack/docs/features/css#tailwind-css For more information, see: https://turbo.build/pack/docs/features/css#tailwind-css
......
import '@/styles/dist.css'; import '@/styles/globals.css';
import React from 'react'; import React from 'react';
import AddressBar from '@/ui/AddressBar'; import AddressBar from '@/ui/AddressBar';
import GlobalNav from './GlobalNav'; import GlobalNav from './GlobalNav';
......
...@@ -2,13 +2,10 @@ ...@@ -2,13 +2,10 @@
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev --turbo", "dev": "next dev --turbo",
"dev:tailwind": "concurrently \"next dev --turbo\" \"npm run tailwind -- --watch\"",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint",
"tailwind": "tailwindcss -i styles/globals.css -o styles/dist.css", "format": "prettier --write \"**/*.{js,ts,tsx,md}\""
"format": "prettier --write \"**/*.{js,ts,tsx,md}\"",
"postinstall": "npm run tailwind"
}, },
"prettier": { "prettier": {
"arrowParens": "always", "arrowParens": "always",
...@@ -18,7 +15,6 @@ ...@@ -18,7 +15,6 @@
}, },
"dependencies": { "dependencies": {
"clsx": "1.2.1", "clsx": "1.2.1",
"concurrently": "7.5.0",
"next": "latest", "next": "latest",
"react": "18.2.0", "react": "18.2.0",
"react-dom": "18.2.0", "react-dom": "18.2.0",
......
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment