clean-css / clean-css-cli

The command line interface to clean-css CSS optimizer
MIT License
305 stars 17 forks source link

Option to remove imported files #1

Closed jakubpawlowicz closed 7 years ago

jakubpawlowicz commented 7 years ago

Opened by @mikkotikkanen in clean-css repo - moving it here as it'll be a CLI feature.

Note that API already exposes a list of imported files under inlinedStylesheets field in output hash.


If you are running master css file which is just split with imports, it would be nice to have r.js styled removing of the imported files

Ie. if

master.css

@import('buttons.css')
body { background: #fff; }

buttons.css

.btn { background: #bada55; }

Would then become...

master.css

.btn { background: #bada55; }
body { background: #fff; }

...with buttons.css removed.

If file is not imported anywhere, it would be just minified as usual.