mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What? Changed the PostCSS plugin format in create-next-app templates from string array syntax to object syntax. ### Why? The array string format for PostCSS plugins is non-standard, and gives errors when loading using [postcss-load-config](https://github.com/postcss/postcss-load-config): ``` TypeError: Invalid PostCSS Plugin found at: plugins[0] ``` This change ensures that Next.js applications using Tailwind CSS can seamlessly integrate with these tools without requiring manual configuration fixes. For example, vitest will crash, which uses `postcss-load-config` under the hood: https://github.com/storybookjs/storybook/issues/30878 ### How? Modified the PostCSS configuration in both JavaScript and TypeScript empty app templates with Tailwind to use the object-based plugin format, which is the standard format recognized by PostCSS tools in the ecosystem. Array syntax: ```tsx const config = { plugins: ["@tailwindcss/postcss"], }; export default config; ``` Object syntax ```tsx const config = { plugins: { "@tailwindcss/postcss": {}, }, }; ``` Co-authored-by: Lee Robinson <[email protected]>
8 lines
94 B
JavaScript
8 lines
94 B
JavaScript
const config = {
|
|
plugins: {
|
|
"@tailwindcss/postcss": {},
|
|
},
|
|
};
|
|
|
|
export default config;
|