broccoli-clean-css
Version:
CSS minifier for Broccoli, using clean-css
63 lines (42 loc) ⢠1.98 kB
Markdown
# broccoli-clean-css
[](https://www.npmjs.com/package/broccoli-clean-css)
[](https://travis-ci.org/shinnn/broccoli-clean-css)
[](https://ci.appveyor.com/project/ShinnosukeWatanabe/broccoli-clean-css)
[](https://coveralls.io/r/shinnn/broccoli-clean-css)
[clean-css](https://github.com/jakubpawlowicz/clean-css) plugin for [Broccoli](https://github.com/broccolijs/broccoli)
```css
a {
color: #FF0000;
}
a {
border-radius: 4px 4px 4px 4px;
}
```
ā
```css
a{color:red;border-radius:4px}
```
## Installation
[Use npm.](https://docs.npmjs.com/cli/install)
```
npm install --save-dev broccoli-clean-css
```
## API
```javascript
const BroccoliCleanCss = require('broccoli-clean-css');
```
### class BroccoliCleanCss(*node* [, *options*])
*node*: `String` (directory path) or `Object` ([Broccoli node](https://github.com/broccolijs/broccoli/blob/master/docs/node-api.md#part-2-node-api-specification))
*options*: `Object` ([clean-css constructor options](https://github.com/jakubpawlowicz/clean-css#constructor-options))
```javascript
//Brocfile.js
const BroccoliCleanCss = require('broccoli-clean-css');
module.exports = new BroccoliCleanCss('path/to/styles');
```
There are some differences from the original [clean-css](https://www.npmjs.com/package/clean-css):
* `rebaseTo` option is regarded as relative to the Broccoli target path.
* `returnPromise` option defaults to `true` and cannot be disabled.
* All problems that clean-css considers as *warnings*, for example broken CSS syntax, are regarded as errors.
## License
Copyright (c) 2014 - 2017 [Shinnosuke Watanabe](https://github.com/shinnn)
Licensed under [the MIT License](./LICENSE).