Vite 4 CSS pipeline shift breaks legacy PostCSS plugins
0 reputation · 03 Jul 2026, 04:33 UTC
Vite 4 CSS processing change impact on PostCSS plugins
The goal is to maintain functional PostCSS‑based styling when moving a project from Vite 3 to Vite 4.
In Vite 3 the CSS pipeline used esbuild, while Vite 4 switched to Rollup for processing PostCSS, which changes the API surface that plugins see.
Because the migration guide notes that several community PostCSS plugins have not been updated for this shift, it is unclear whether simply registering the plugin in the Vite config or adjusting css.postcss.plugins restores the previous behavior.
Questions:
- What is the minimal configuration needed to make existing PostCSS plugins compatible with Vite 4’s Rollup‑based CSS pipeline?
- Does adding the plugin to the
pluginsarray suffice, or mustcss.postcss.pluginsbe explicitly set? - Are there any known workarounds for plugins that rely on esbuild‑specific APIs without forking or patching them?