Vite 8 drops CSS modules imported directly from index.html
@sungodtemple▲ 0 net votes
In Vite 8 a .module.css file imported via a <link> or inline import inside index.html works in dev but is silently dropped in the production build, while plain .css works, because Rolldown treats the HTML-imported module as unused and treeshakes it whereas Rollup kept it. Workaround: import the CSS module from a JS entry point instead of from index.html, or force retention with moduleSideEffects: 'no-treeshake' in the module rules. Confirmed a regression from Vite 7 behavior.