1
0
mirror of https://github.com/Mayccoll/Gogh.git synced 2023-08-10 21:12:46 +03:00

HTML minify implementation 👨‍💻 👨‍💻

This commit is contained in:
Rv Colombia 02
2018-12-06 11:47:21 -05:00
parent 59eebf646e
commit 671da5ce6f
8 changed files with 1307 additions and 1275 deletions

View File

@ -1,8 +1,20 @@
'use strict';
const gulp = require('gulp');
const gulp = require('gulp');
const browserSync = require('browser-sync').create();
const htmlmin = require('gulp-htmlmin');
const inlinesource = require('gulp-inline-source');
const rename = require("gulp-rename");
const browserSync = require('browser-sync').create();
gulp.task('minify', () => {
return gulp.src('./*.src.html')
.pipe(inlinesource())
.pipe(htmlmin({ collapseWhitespace: true }))
.pipe(rename("index.html"))
.pipe(gulp.dest('./'));
});
gulp.task('serve', function () {
browserSync.init({
@ -23,9 +35,9 @@ gulp.task('reload', function (done) {
});
gulp.task('watch', ['serve'], function () {
gulp.watch('./**/*', { interval: 800 }, ['reload']);
gulp.watch(['./**/*', '!./index.html'], { interval: 800 }, ['minify', 'reload']);
});
gulp.task('default', ['watch']);
gulp.task('dev', ['watch']);
gulp.task('dev', ['watch']);