postcss-auto-modules
v1.0.1
Published
PostCSS modules wrapper that automatically outputs js files for library code.
Downloads
9
Maintainers
Readme
Details
This module is intended to be used in library code that would like to use css modules output by the postcss cli WITHOUT having to think about JSON files and the like.
The goal is to automatically treat *.module.*
files as css modules (similar to bundler integrations in vite/webpack/etc).
This plugin will also output a .css.js
file for every css module which is then imported from your app and re-exports the JSON from postcss-modules
and imports the built css file.
Getting Started
Install
npm i -D postcss-auto-modules
Configure PostCSS
{
"plugins": {
"postcss-auto-modules": {}
}
}
Note: all options forwarded to postcss-modules plugin
Use PostCSS CLI
postcss ./src/**/*.css -d dist --base src