You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just want to share a gulp recipe to minify css using the CleanCSS library, with the help of vinyl-map (a really useful library by @hughsk that you can use adapt most nodejs modules to work into your gulp streams)
vargulp=require('gulp');varCleanCSS=require('clean-css');varmap=require('vinyl-map');gulp.task('minify-css',functionminifyCSSTask(){// this snippet basically replaces `gulp-minify-css`varminify=map(function(buff,filename){returnnewCleanCSS({// specify your clean-css options here}).minify(buff.toString());});returngulp.src('css/**/*.css').pipe(minify).pipe(gulp.dest('dist'));});
This helps to reduce the need for a gulp-plugin wrapping around clean-css and allows you to use clean-css outside of your gulpfile.js
The text was updated successfully, but these errors were encountered:
Hi guys,
I just want to share a
gulp
recipe to minify css using theCleanCSS
library, with the help ofvinyl-map
(a really useful library by @hughsk that you can use adapt most nodejs modules to work into your gulp streams)This helps to reduce the need for a gulp-plugin wrapping around clean-css and allows you to use clean-css outside of your
gulpfile.js
The text was updated successfully, but these errors were encountered: