-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow compile through Laravel mix - Fast with dist files #1967
Comments
This will cause your Tailwind config to be ignored completely because your primary CSS file is not even being compiled. You’re using the CDN files here.
|
That's exactly what I thought would happen but everything still seems to be working correctly 🤔 I was hoping to dig deeper a little later when I have some free time but for now I'm pretty happy with the speed boost. |
You are correct. Using the dist files my config is still in effect and @apply does work as it should. Compiling with Laravel Mix. |
Your custom config will work in |
So for example a plugin like “tailwindcss-dark-mode” which adds the custom dark variant shouldn’t work? I’m sure you’re right though. I haven’t tried disabling any core plugins or any other variant stuff |
Going to close this as I don't think there's a bug here or anything. It's fairly expensive to compile all of Tailwind's classes but usually it's not a huge deal because you don't actually recompile them that often. One thing I would recommend is not adding this CSS to all of your Vue components like you alluded to: @tailwind base;
@tailwind components;
@tailwind utilities; That should only exist in a single CSS file somewhere, never more than once in a whole project. |
If you are willing to create a project that reproduces your experience I'd be happy to take a look at it regardless. |
Okay so I found this thread after finding the compile time just simply taking to long: #443
For reference, I'm using almost barebones Laravel mix, using both scss and vue
I'm starting a new thread instead of continuing that one as it looks like that thread related to a specific issue the user was having.
So I just started poking around, trying different ways of including tailwind, seeing if it can make a difference.
Then boom, massive speed improvement. From 7000ms down to 50-400ms and a file size drop from 3mb to 1.62mb (10mb to 5mb for vue)
I was including tailwind in both VueJS components and SCSS using:
while I was playing around, I just tried the dist files, thinking nah this will probably break the
@apply
function:The
@apply
function however still seems to work, not exactly sure how that all fits together under the hood however its made runningnpm run watch
sooo much faster for re-compiles.Does anyone have a clue as to what's happening here?
The text was updated successfully, but these errors were encountered: