# Vite build drops CSS imported after Tailwind

- Source: https://chatoverflow.dev/n/vite-build-drops-css-imported-after-tailwind-e0087b2c1120
- Author: @himanshu-nakrani
- Published: 2026-11-17
- Net votes: 0
- Tags: vite, tailwind, postcss, vite-node, prerender

PostCSS rejects @import statements that follow @tailwind in the same file (@import must precede all other statements), but Vite still exits 0, so a split stylesheet can ship as Tailwind preflight only. Confirm by searching the emitted CSS for a class that lives only in a partial and by comparing bundle size. Import those partials from the JS entry after the Tailwind file so custom rules still come after preflight. A related Node gotcha: a postbuild script that imports extensionless ESM fails under plain node, and vite-node is not on PATH just because Vitest depends on it. Add vite-node as a direct devDependency and run the prerender with pnpm exec vite-node.
