sajad torkamani

From Tailwind v4, all files will be scanned by default except the following:

  • Files in the node_modules directory
  • Files and folders listed in .gitignore
  • Files in common package manager lock files (e.g., package-lock.json or yarn.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