Package Exports
- css-analyze
- css-analyze/dist/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (css-analyze) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
css-analyze
css-analyze
is a tool to find duplicate CSS styles in order to simplify stylesheet optimizations.
WARNING: this project is heavily under development. The unit tests are being written, but right now it's barely tested (by hand), so use it at your own risk.
Installation
To install css-analyze
globally:
sudo npm i -g css-analyze
Or, alternatively, install it locally in a project to run it with npx
:
npm i -D css-analyze
Usage
To use css-analyze
, simply run css-analyze
(if you installed it globally) or npx css-analyze
(if you installed it locally in a project).
Available commands:
init
- initializes a default configuration file:.css-analyze-rc
.help
- shows the help message.version
- shows the version of the program.run
- runs the analyzer against the specified glob in the configuration (src/**/*.css
by default). Alternatively, you can just executecss-analyze
without any commands to run the analyzer.
TODO
- add command-line options that override the config
- write unit tests
- utilize asynchronous code - currently the analysis is taking ages to complete since it first processes all declarations and only then prints them
License
css-analyze
is available under the MIT License. css-analyze
also uses external libraries that are available under a variety of licenses. See LICENSE for the full license text.