union_auto_test/client/gulp/tasks/html.js

51 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import fileInclude from "gulp-file-include";
import webpHtmlNosvg from "gulp-webp-html-nosvg";
import versionNumber from "gulp-version-number";
//import pug from "gulp-pug";
export const html = () => {
return app.gulp.src(app.path.src.html)
.pipe(app.plugins.plumber(
app.plugins.notify.onError({
title: "HTML",
message: "Error: <%= error.message %>"
}))
)
.pipe(fileInclude())
/*
.pipe(pug({
// Cжатие HTML файла
pretty: true,
// Показывать в терминале какой файл обработан
verbose: true
}))
*/
.pipe(app.plugins.replace(/@img\//g, 'img/'))
.pipe(
app.plugins.if(
app.isBuild,
webpHtmlNosvg()
)
)
.pipe(
app.plugins.if(
app.isBuild,
versionNumber({
'value': '%DT%',
'append': {
'key': '_v',
'cover': 0,
'to': [
'css',
'js',
]
},
'output': {
'file': 'gulp/version.json'
}
})
)
)
.pipe(app.gulp.dest(app.path.build.html))
.pipe(app.plugins.browsersync.stream());
}