A Rollup plugin for handling CSS Modules with PostCSS. Current stable version is 0.0.25, released with limited update cadence (sporadic). It provides basic CSS Modules support in Rollup bundles by leveraging PostCSS for transformation. Compared to alternatives like rollup-plugin-postcss, this plugin is lighter but less maintained, with fewer configuration options and no built-in CSS extraction. Suitable for simple projects that need CSS Modules without extra features.
npm install rollup-plugin-css-moduleVerified import paths — ran on the pinned version, not inferred.
Shows basic Rollup config with css-module plugin, using include/exclude patterns and insert mode.
Set insert: true explicitly or inline CSS via other means.
Add include/exclude patterns matching your CSS file names.
Disable CSS modules in rollup-plugin-postcss if both are used.
npm install postcss --save-dev
Use `import cssModule from 'rollup-plugin-css-module'`
Ensure plugin is in plugins array and include pattern matches your CSS.