ubdate
This commit is contained in:
79
node_modules/gulp-clean-css/README.md
generated
vendored
Normal file
79
node_modules/gulp-clean-css/README.md
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
# gulp-clean-css
|
||||
|
||||
[](https://travis-ci.org/scniro/gulp-clean-css)
|
||||
[](https://david-dm.org/scniro/gulp-clean-css)
|
||||
[](https://david-dm.org/scniro/gulp-clean-css#info=devDependencies)
|
||||
[](https://coveralls.io/github/scniro/gulp-clean-css)
|
||||
[](https://www.npmjs.com/package/gulp-clean-css)
|
||||
[](https://www.npmjs.com/package/gulp-clean-css)
|
||||
[](https://github.com/alferov/awesome-gulp#minification)
|
||||
|
||||
> [gulp](http://gulpjs.com/) plugin to minify CSS, using [clean-css](https://github.com/jakubpawlowicz/clean-css)
|
||||
|
||||
## Regarding Issues
|
||||
|
||||
This is just a simple [gulp](https://github.com/gulpjs/gulp) plugin, which means it's nothing more than a thin wrapper around `clean-css`. If it looks like you are having CSS related issues, please contact [clean-css](https://github.com/jakubpawlowicz/clean-css/issues). Only create a new issue if it looks like you're having a problem with the plugin itself.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm install gulp-clean-css --save-dev
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### cleanCSS([*options*], [*callback*])
|
||||
|
||||
#### options
|
||||
|
||||
See the [`CleanCSS` options](https://github.com/jakubpawlowicz/clean-css#how-to-use-clean-css-api).
|
||||
|
||||
```javascript
|
||||
const gulp = require('gulp');
|
||||
const cleanCSS = require('gulp-clean-css');
|
||||
|
||||
gulp.task('minify-css', () => {
|
||||
return gulp.src('styles/*.css')
|
||||
.pipe(cleanCSS({compatibility: 'ie8'}))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
```
|
||||
|
||||
#### callback
|
||||
|
||||
Useful for returning details from the underlying [`minify()`](https://github.com/jakubpawlowicz/clean-css#using-api) call. An example use case could include logging `stats` of the minified file. In addition to the default object, `gulp-clean-css` provides the file `name` and `path` for further analysis.
|
||||
|
||||
```javascript
|
||||
const gulp = require('gulp');
|
||||
const cleanCSS = require('gulp-clean-css');
|
||||
|
||||
gulp.task('minify-css', () => {
|
||||
return gulp.src('styles/*.css')
|
||||
.pipe(cleanCSS({debug: true}, (details) => {
|
||||
console.log(`${details.name}: ${details.stats.originalSize}`);
|
||||
console.log(`${details.name}: ${details.stats.minifiedSize}`);
|
||||
}))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
```
|
||||
|
||||
[Source Maps](http://www.html5rocks.com/tutorials/developertools/sourcemaps/) can be generated by using [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps).
|
||||
|
||||
```javascript
|
||||
|
||||
const gulp = require('gulp');
|
||||
const cleanCSS = require('gulp-clean-css');
|
||||
const sourcemaps = require('gulp-sourcemaps');
|
||||
|
||||
gulp.task('minify-css',() => {
|
||||
return gulp.src('./src/*.css')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(cleanCSS())
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE) © 2020 [scniro](https://github.com/scniro)
|
||||
Reference in New Issue
Block a user