A Vite plugin that enables CSS Modules on all stylesheets, not only those ending in `.module.css`. Version 0.0.1, early stage with no established release cadence. Differentiators: eliminates the `.module` filename convention for CSS Modules, allows treating any CSS/less file as a module. Supports precompilers (less built-in) and postcss-modules configuration. Requires Vite >2.0.0-0 and multiple peer dependencies. Currently minimal documentation and likely unstable.
npm install vite-plugin-css-modulesVerified import paths — ran on the pinned version, not inferred.
Enables CSS Modules on all stylesheets in a Vite project by adding the plugin to vite.config.ts.
Ensure all style files are imported with class name references, or migrate to explicit .module files for module behavior.
Install exact peer dependency versions as listed in package.json.
Avoid processing untrusted less files or override precompiler with safer options.
Evaluate using 'vite-plugin-css-modules' (different) or roll your own postcss setup.
Run 'npm install vite-plugin-css-modules' or 'yarn add vite-plugin-css-modules'.
Use 'import vitePluginCssModules from 'vite-plugin-css-modules'' instead of 'import { vitePluginCssModules } ...'.Install postcss@^8.3.6 or later with 'npm install postcss@^8.3.6'.