cmc

css-modules-compiler

Compile CSS Modules to static CSS and remove non-standard code from the JavaScript files

Showing:

Popularity

Downloads/wk

4

GitHub Stars

13

Maintenance

Last Commit

5yrs ago

Contributors

2

Package

Dependencies

15

Size (min+gzip)

503.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

build status npm version npm downloads Commitizen friendly

CSS Modules Compiler

The compiler is a small autonomous Node.js module that can be used programmatically from JavaScript or directly from the CLI.

To use the module is enough to invoke it passing a source folder, the folder will be traversed and all the CSS files will be compiled as css-modules, all the generated CSS files will be merged, deduped and optimized into a single CSS file. All the es2015 modules will be checked using an AST parser and all the css import declaration will be substituted with a static object containing the generated CSS class names.

The compile command accepts several options: the postcss plugins to be used when compiling css files, a blacklist of patterns used to avoid compilation of non-css-modules files, a target folder to duplicate the source and avoid changing the original sources and more.

Documentation

See the official documentation

Install

css-modules-compiler is available as npm module, to use it on your project run:

npm install --save-dev css-modules-compiler

Tests

npm test

Try it

To try the module clone the repository, install npm dependencies and then run the following commands to see it in action.

npm run examples:basic
npm run examples:advanced

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial