Upgraded taiwind V3 to V4 - with webpack but tailwind css file not genarating #18448
Replies: 2 comments 4 replies
-
Could you clarify what you mean by "not [generating]"? Consider providing a git repo that reproduces the unexpected behavior. |
Beta Was this translation helpful? Give feedback.
-
Problempostcss.config.js - From v4 onwards, make sure to use Also, I would use the PostCSS object-syntax instead of an array: export default {
plugins: {
"@tailwindcss/postcss": {},
}
} Note: Since I've been using Vite, I rarely work with Webpack anymore, so I don't really know how it works with ReviewPlease forgive me for being a bit confused, but one thing really struck me: why are you importing By the way, for tailwindcss, basically one line is enough. @import 'tailwindcss';
/* @import 'tailwindcss/preflight'; */
/* @import 'tailwindcss/utilities'; */ If for some reason you need the longer version, it looks like this without the @layer theme, base, components, utilities;
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/preflight.css" layer(base);
@import "tailwindcss/utilities.css" layer(utilities); Also, you are importing Also, completely unrelated to the problem, but in v4 there is no need for And using
@layer base {
body {
@apply antialiased;
@apply text-slate-900;
font-family: 'Inter', sans-serif;
overflow-y: scroll !important;
}
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
npx @tailwindcss/upgrade
webpack.config.js
looks like thispostcss.config.js
looks like thisindex.css
look like this ...tailwind.css
look like thispackages version -
"@tailwindcss/postcss": "^4.1.11" "tailwindcss": "^4.1.11", "webpack": "^5.99.9",
Beta Was this translation helpful? Give feedback.
All reactions