@tailwindcss/upgrade should add source(none) when content is defined in the legacy tailwind.config.js #18987
Bouhnosaure
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi !
When migrating from Tailwind CSS v3 to v4 using
npx @tailwindcss/upgrade
, the tool converts the legacy content property from tailwind.config.js into@source
directives inside the CSS entrypoint.That's cool but it does not enforce it as I've read after spending a lot of time understanding why the builds are different on my two identical servers causing one to be without CSS after using my tool to upload and purge my CDN.
However, in v4 the default behavior is to scan all files except those ignored by
.gitignore
. This can lead to unexpected behavior if the legacy config previously restricted scanning to specific directories only.For instance, in the
.gitignore
of laravel thestorage/framework
is not ignored, but it's files are ignored inside the folder by another.gitignore
. So if you have a sharedstorage
folder with old cached views, this can lead to different files on same codebase, not due to tailwind but due to the missingsource(none)
when upgrading from V3 to V4.Legacy config:
After upgrade to V4:
Expected behavior when the legacy config has explicit
content
paths (indicating intentional restriction), the upgrade tool should generate:For me it can make more deterministic builds, better migration experience and prevent cache pollution when building assets
Thanks !
Alex
Beta Was this translation helpful? Give feedback.
All reactions