Slow compile when using Tailwind CSS + Postcss + Nextjs #2236
Unanswered
animeshchat
asked this question in
Help
Replies: 1 comment 1 reply
-
@animeshchat AFAIK, Next recompiling the CSS files triggers a whole recompile of Tailwind. So maybe don't write custom CSS (and use the utilities Tailwind provides). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I just started using Tailwind CSS with my Nextjs project. Each change in css takes ~10 seconds to compile (hot reload).
I have a global.css file that is included in _app.js.
/* global.css */
@import "tailwindcss/base";
@import "./base.css";
@import "tailwindcss/components";
@import "./common.css";
@import "tailwindcss/utilities";
@import "./utilities.css";
/* package.json */
"dependencies": {
"next": "^9.5.2",
"postcss-flexbugs-fixes": "^4.2.1",
"postcss-import": "^12.0.1",
"postcss-preset-env": "^6.7.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"swr": "^0.3.1",
"tailwindcss": "^1.7.3"
}
base.css, common.css, and utilities.css are my files that are used to add custom classes.
Any changes made in any of these files takes a while to compile.
Am I doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions