Skip to content

Instantly share code, notes, and snippets.

@arafathusayn
Created October 18, 2017 08:11
Show Gist options
  • Save arafathusayn/d4af44edf8e2102873e08af375a40b1a to your computer and use it in GitHub Desktop.
Save arafathusayn/d4af44edf8e2102873e08af375a40b1a to your computer and use it in GitHub Desktop.
Laravel View Files Minification (HTML, CSS & JS) with Gulp
// > gulp minify
const htmlmin = require('gulp-htmlmin')
const gulp = require('gulp')
gulp.task('minify', () => {
const opts = {
collapseWhitespace: true,
removeAttributeQuotes: true,
removeComments: true,
minifyCSS: true,
minifyJS: true
}
return gulp.src('./storage/framework/views/*')
.pipe(htmlmin(opts))
.pipe(gulp.dest('./storage/framework/views/'))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment