Which files does Tailwind scan by default?
12 February 2026 (Updated 12 February 2026)
From Tailwind v4, all files will be scanned by default except the following:
- Files in the
node_modulesdirectory - Files and folders listed in
.gitignore - Files in common package manager lock files (e.g.,
package-lock.jsonoryarn.lock) - CSS files
- Binary files like images, videos or ZIP files
You can explicitly register additional files by using the @source directive. For example:
@import "tailwindcss";
@source "../node_modules/@acmecorp/ui-lib";
This can be useful if you need to scan an external library that’s built on Tailwind because NPM dependencies are ignored by default.
You can use the @source not directive to explicitly ignore specific paths.
@import "tailwindcss";
@source not "../src/components/legacy";
Use source(none) to disable the automatic scanning and instead specify each source explicitly.
@import "tailwindcss" source(none);
@source "../admin";
@source "../shared";
Related links
Tagged:
Tailwind