A minimal Vite project demonstrating Tailwind CSS v4 with multiple CSS files where one imports the other.
src/
├── style.css ← Entry CSS file: imports Tailwind and components.css
├── components.css ← Imported by style.css, uses @apply utilities
└── main.js ← Only imports style.css
npm install
npm run devIn src/style.css, the import of components.css must use a relative path prefix (./):
/* Works */
@import "./components.css";
/* Fails */
@import "components.css";When the ./ prefix is omitted, Tailwind's Vite plugin treats the bare "components.css" as a package/module import rather than a relative file path. This causes a build error because no components.css package exists in node_modules.
The ./ prefix explicitly tells the resolver that this is a relative file path in the same directory, bypassing module resolution entirely.