Вот такой код у меня для работы с HTML файлами.
import fileInclude from "gulp-file-include";
import webpHtmlNosvg from "gulp-webp-html-nosvg";
import versionNumber from 'gulp-version-number';
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(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', 'img']
},
'output': {
'file': 'gulp/version.json'
}
})
)
)
.pipe(app.gulp.dest(app.path.build.html))
.pipe(app.plugins.browsersync.stream());
}
Вот такая ошибка:
gulp-notify: [HTML] Error: Callback called multiple times
(node:10496) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead. (Triggered by calling processImmediate on process.)
(Use `node --trace-deprecation ...` to show where the warning was created)
[gulp-version-number] Output to file: gulp/version.json
Все файлы собираются кроме HTML файлов.