cef62 / css-modules-compiler Goto Github PK
View Code? Open in Web Editor NEWCompile CSS Modules to static CSS and remove non-standard code from the JavaScript files
Home Page: https://cef62.github.io/css-modules-compiler/
License: MIT License
Compile CSS Modules to static CSS and remove non-standard code from the JavaScript files
Home Page: https://cef62.github.io/css-modules-compiler/
License: MIT License
Add documentation for the API in the readme and some usage examples.
Often the source folder contains both local
and global
css files. The module should be able to ignore css files based on user defined patterns.
For example: ignore all css files matching *.global
.
Also should be possible to request to copy without modification all the filtered css.
Wouldn't it be better to rename the files in the following way?
src/css-modules-compiler.js
=> src/compiler.js
src/css-modules-extractor.js
=> src/extractor.js
src/update-css-modules-imports.js
=> src/update-imports.js
(or just src/updater.js
for consistency)
bin/css-module-compiler.js
=> bin/css-modules-compiler.js
What do you think @cef62?
I don't have a strong opinion on it, but I feel that 'styles.css' sounds better :)
What do you think?
I was about to start writing the docs for the cli
when I realised that we should accept the source folder as the first parameter (without any flag), like:
css-modules-compiler compile <source> [options]
What do you think @cef62?
We should avoid using console.*
and use a proper logger library that gets activated by a verbose
or debug
flag.
The compiler
is supposed to only compose the submodules but at the moment it has some logic inside and it counts more than 100 lines.
We should split it into smaller (and more testable) submodules.
My idea:
transformer
convertCssMapToAst
convertCssMapToAstMap
utils
updateFilesystem
cleanCss
concatenateCss
copySourceFolder
optimizer
clearJsonMap
Any thoughts @cef62?
More than happy to do it but I want your ok to proceed : )
If a class only composes other classes (without adding any styles) it gets compiled as an empty class.
It would be nice to remove those empty classes from the json map.
This thread will be used to discuss initial goals and requirements for the compiler. The list of features will be used to design the compiler.
I'm guessing this project is abandoned, but in case it isn't, I'm getting the following errors when running:
css-modules-compiler compile ./src -t ./lib
Error Message (One for every js file)
(node:95993) Warning: a promise was rejected with a non-error: [object Undefined]
The CSS file is successfully generated, but the JS files are just copied to the output directory - no styles object is added.
Version 1.0.0
Node v6.9.5
Should we add power-assert to improve the messages for errors with the tests assertions?
Currently it's possibile to configure postcss plugins only using the javascript API of the module. We should support it also for the CLI.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.