-const { src, dest, task } = require("gulp");
+const { src, dest, task, series } = require("gulp");
const clean = require('gulp-clean');
const gzip = require('gulp-gzip');
const inlineSource = require('gulp-inline-source');
let fileSize = 0;
task('clean', () => {
- return src('dist', {read: false, allowEmpty: true})
+ return src('dist', { read: false, allowEmpty: true })
.pipe(clean());
});
-task('default', () => {
+task('inline', () => {
return src('dist/index.html')
.pipe(inlineSource())
+ .pipe(rename("inline.html"))
+ .pipe(dest('dist/'));
+});
+
+task('default', series('inline', () => {
+ return src('dist/inline.html')
.pipe(through2.obj((file, enc, cb) => {
fileSize = file.contents.length;
return cb(null, file);
}))
.pipe(rename("html.h"))
.pipe(dest('../src/'));
-});
+}));
+
"prestart": "gulp clean",
"start": "webpack serve",
"build": "NODE_ENV=production webpack && gulp",
+ "inline": "NODE_ENV=production webpack && gulp inline",
"check": "gts check",
"fix": "gts fix"
},