https://github.com/shinnn/broccoli-clean-css
A Broccoli plugin to minify CSS with clean-css
https://github.com/shinnn/broccoli-clean-css
broccoli broccoli-plugin clean-css css javascript minification nodejs optimization stylesheet
Last synced: about 2 months ago
JSON representation
A Broccoli plugin to minify CSS with clean-css
- Host: GitHub
- URL: https://github.com/shinnn/broccoli-clean-css
- Owner: shinnn
- License: mit
- Created: 2014-02-24T11:35:37.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-10-28T23:32:53.000Z (over 4 years ago)
- Last Synced: 2025-03-28T21:01:29.319Z (2 months ago)
- Topics: broccoli, broccoli-plugin, clean-css, css, javascript, minification, nodejs, optimization, stylesheet
- Language: JavaScript
- Homepage:
- Size: 156 KB
- Stars: 13
- Watchers: 2
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# broccoli-clean-css
[](https://www.npmjs.com/package/broccoli-clean-css)
[](https://travis-ci.com/shinnn/broccoli-clean-css)
[](https://codecov.io/gh/shinnn/broccoli-clean-css)A [Broccoli](https://github.com/broccolijs/broccoli) plugin to minify CSS with [clean-css](https://github.com/jakubpawlowicz/clean-css)
```css
a {
color: #ff0000;
}b {
/* nothing */
}
```↓
```css
a{color:red}
```## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
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):
* `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 - 2019 [Watanabe Shinnosuke](https://github.com/shinnn)
Licensed under [the MIT License](./LICENSE).