[12.x] Remove not necessary tailwindcss source declarations #6588
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In PR #6523, the settings ensuring TailwindCSS v4 compatibility were added to version 12.x. However, three of the declared sources are unnecessary and only increase the codebase size.
TailwindCSS v4 automatically detects all sources that are not in
.gitignore
and are not special files. See more details here:Resources
As a result, there is no need to declare
resources/**/*.blade.php
andresources/**/*.js
as sources.Storage Views
Additionally, scanning cached files in
storage/framework/views/*.php
is unnecessary, as TailwindCSS can discover the required classes by mapping the original source files.Mapping cached files can lead to incorrect results if the developer dynamically constructs class names, e.g.,
bg-red-$custom
, where$custom
might default to500
. In this case, due to the storage source,bg-red-500
will be added to the prod, but the other classes won't, and the developer won't understand the explanation.To avoid this, the TailwindCSS v4 documentation specifically advises developers to avoid such dynamic declarations.
So, if the classes are properly declared in the source (whether in app, resources, or elsewhere), they will be correctly included in the compiled CSS without the need to consider the storage folder.