Last active
July 31, 2018 07:16
-
-
Save htr3n/d91b6937e88050c4e7e820d82be2c2e1 to your computer and use it in GitHub Desktop.
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
const htmlmin = require("gulp-htmlmin"); | |
//... | |
gulp.task("minify-html", function(done) { | |
let publicFolder = "./public"; | |
let html = publicFolder + "/**/*.html"; | |
let css = publicFolder + "/**/*.css"; | |
let js = publicFolder + "/**/*.js"; | |
let dest = "./dist"; | |
log("Minifying HTML/CSS/JS in '" + publicFolder + "' to '" + dest + "'"); | |
gulp.src(publicFolder + "/**") | |
.pipe(gulp.dest(dest)); | |
gulp.src([html, css, js]) | |
.pipe(htmlmin({ collapseWhitespace: true })) | |
.pipe(gulp.dest(dest)) | |
.on("end", done); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment