Skip to content
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

"@tailwindcss/vite": "4.0.8" and "@tailwindcss/vite": "4.0.9" have massively increased load times for the CSS in Vite. #16911

Open
terryupton opened this issue Mar 3, 2025 · 3 comments

Comments

@terryupton
Copy link

So I have noticed drastically increased load times when using Vite and Tailwind when updating to "@tailwindcss/vite": "4.0.8" and "@tailwindcss/vite": "4.0.9".

"@tailwindcss/vite": "4.0.8" and "@tailwindcss/vite": "4.0.9"
Image

"@tailwindcss/vite": "4.0.7" and lower.
Image

Not sure what is causing this.
Happy to share more information about my setup or debug further with instructions.

Thanks

@philipp-spiess
Copy link
Member

Hey! Can you post a repro?

One thing I can think of is that yhe automatic content detection, which no longer works off only the Vite module graph, now scans through a bunch of unwanted files. Does your codebase have a .gitignore file?

@terryupton
Copy link
Author

Hey @philipp-spiess

Not sure what you want when you say Can you post a repro? ?
Happy to try and provide what I can...

I am working on a Craft CMS project. Here are some (useful?) extracts...

index.css

@import "tailwindcss";
@import "./partials/brand.css";
@import "./partials/animation.css";
@import "./partials/grid.css";
@import "./partials/prose.css";

@plugin '@tailwindcss/forms';
@source "../../templates";

gitginore

# CRAFT ENVIRONMENT
.env*
!.env.example

# COMPOSER
/vendor/*

# CRAFT STORAGE
/storage/*
!/storage/.gitkeep
!/storage/rebrand

# ASSETS
/web/uploads/*
/web/resources/*
/web/feeds/*
!/web/uploads/.gitkeep
/web/imager/*
/web/transforms/*
/web/cpresources/*
/web/cp-resources/*
/scripts
/feeds

# BUILD FILES
/bower_components/*
/node_modules/*
/build/*
/yarn-error.log
/npm-debug.log

# MISC FILES
.cache
.DS_Store
Thumbs.db
.idea/*
.project
.settings
*.esproj
*.sublime-workspace
*.sublime-project
*.tmproj
*.tmproject
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
config.codekit3
prepros-6.config

#Sitemaps
ror.xml
sitemap.xml
urllist.txt

@philipp-spiess
Copy link
Member

Not sure what you want when you say Can you post a repro? ?

Ah, sorry for not being clear enough. It would be helpful if you can create a small repository that reproduces the error and send us the link to it (e.g. via a GitHub repository). Ideally we can run the setup locally so that we can quickly iterate on it and figure out whats wrong.

From the two files you posted there's nothing that stands out to me I'm afraid.

What you could also try is to do a Vite build but set the DEBUG environment variable to 1. That should print a bunch of Tailwind CSS diagnostics that might help us pinpoint into what the issue is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants