`@source` on one file inside `node_modules` scans the file's whole folder when automatic detection is on#20637
What version of Tailwind CSS are you using?
v4.3.3 (also 0.0.0-insiders.8cc0551)
What build tool (or framework if it abstracts the build tool) are you using?
@tailwindcss/cli 4.3.3 in the reproduction. Found with @tailwindcss/postcss 4.3.3 in Next.js 15.5.
What version of Node.js are you using?
v26.13.0 (the Next.js app also builds on Vercel's Node 22.x)
What browser are you using?
N/A, the generated CSS is wrong.
What operating system are you using?
macOS 26
Reproduction URL
https://github.com/pawelkrystkiewicz/tailwind-source-repro
Describe your issue
I maintain a React component library, chunks-ui. Since 0.6.0 it ships one CSS file per component, so an app can generate only the classes of the components it renders:
@import "tailwindcss";
@import "chunks-ui/theme.core.css";
@import "chunks-ui/sources/button.css";
Each sources file is generated at build time and lists that component's built files with @source, for example and the chunks it imports. Installed from npm, though, an app that imports only still gets the classes of every component in the package.