Last active
March 14, 2019 18:36
-
-
Save LoyEgor/db018a15f2e26834d662ffcde35ffdfb to your computer and use it in GitHub Desktop.
compress css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// install | |
// npm i gulp-concat gulp-clean-css gulp-uncss | |
var concat = require('gulp-concat'); | |
var cleanCSS = require('gulp-clean-css'); | |
var uncss = require('gulp-uncss'); | |
// concat, clean and remove unused css | |
gulp.task('compress:css', function() { | |
var cssreset = './app/css/reset.css'; | |
var cssplug = './app/css/plugins.css'; | |
var cssfonta = './app/css/font-awesome.min.css'; | |
var cssstyle = './app/css/style.css'; | |
var csscolor = './app/css/color.css'; | |
var cssmy = './app/css/my.css'; | |
return gulp.src([cssreset, cssplug, cssfonta, cssstyle, csscolor, cssmy]) | |
.pipe(concat('style.css')) | |
.pipe(uncss({ | |
html: ['./app/*.html'] | |
})) | |
.pipe(cleanCSS()) | |
.pipe(gulp.dest('./dist/css')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment