Files
fb8798a23b fix: Update PostCSS configuration in create-next-app empty template (#77376)
### 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]>
2025-03-31 08:44:09 -05:00

8 lines
94 B
JavaScript

const config = {
plugins: {
"@tailwindcss/postcss": {},
},
};
export default config;