Skip to content

Commit 02831c2

Browse files
authored
chore: use Tailwind Turbopack loader instead of PostCSS (#489)
Aligns the template and docs apps with the new create-next-app default from vercel/next.js#96606, which uses @tailwindcss/turbopack and a Turbopack CSS loader rule for Tailwind projects on the Turbopack path instead of routing CSS through PostCSS. - add the turbopack.rules CSS rule to both next.config.ts files - delete postcss.config.mjs from both apps - swap @tailwindcss/postcss for @tailwindcss/turbopack, drop postcss No globals.css changes are needed; @import "tailwindcss", the typography plugin, @theme inline, and tw-animate-css all work unchanged. Emitted CSS is byte-identical to the PostCSS output in both apps.
1 parent d1d60dc commit 02831c2

7 files changed

Lines changed: 25 additions & 39 deletions

File tree

apps/docs/next.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ import type { NextConfig } from "next";
44
const withMDX = createMDX();
55

66
const config: NextConfig = {
7+
turbopack: {
8+
rules: {
9+
"*.css": {
10+
as: "*.css",
11+
loaders: ["@tailwindcss/turbopack"],
12+
},
13+
},
14+
},
715
images: {
816
formats: ["image/avif", "image/webp"],
917
remotePatterns: [

apps/docs/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"typecheck": "tsc --noEmit"
1313
},
1414
"dependencies": {
15-
"@tailwindcss/postcss": "4.3.3",
15+
"@tailwindcss/turbopack": "4.3.3",
1616
"@types/mdx": "2.0.14",
1717
"@types/node": "26.1.2",
1818
"@types/react": "19.2.18",
@@ -32,7 +32,6 @@
3232
"next": "16.3.0",
3333
"oxfmt": "0.61.0",
3434
"oxlint": "1.76.0",
35-
"postcss": "8.5.22",
3635
"radix-ui": "1.6.0",
3736
"react": "19.2.8",
3837
"react-dom": "19.2.8",

apps/docs/postcss.config.mjs

Lines changed: 0 additions & 5 deletions
This file was deleted.

apps/template/next.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ const nextConfig: NextConfig = {
5454
unoptimized: !!process.env.V0_CALLBACK_URL,
5555
},
5656
reactCompiler: true,
57+
turbopack: {
58+
rules: {
59+
"*.css": {
60+
as: "*.css",
61+
loaders: ["@tailwindcss/turbopack"],
62+
},
63+
},
64+
},
5765
async rewrites() {
5866
return {
5967
beforeFiles: [

apps/template/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@json-render/react": "0.19.0",
2121
"@shopify/api-codegen-preset": "2.0.1",
2222
"@shopify/hydrogen": "0.0.0-preview-116d5d7-20260730141607",
23-
"@tailwindcss/postcss": "4.3.3",
23+
"@tailwindcss/turbopack": "4.3.3",
2424
"@tailwindcss/typography": "0.5.20",
2525
"@types/node": "26.1.2",
2626
"@types/react": "19.2.18",
@@ -37,7 +37,6 @@
3737
"next-intl": "4.13.4",
3838
"oxfmt": "0.61.0",
3939
"oxlint": "1.76.0",
40-
"postcss": "8.5.25",
4140
"react": "19.2.8",
4241
"react-dom": "19.2.8",
4342
"server-only": "0.0.1",

apps/template/postcss.config.mjs

Lines changed: 0 additions & 7 deletions
This file was deleted.

pnpm-lock.yaml

Lines changed: 7 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)