Gulp обнуляет index.html+ не работает @@include
gulpfile.js:
let project_folder = "dist";
let source_folder = "#src";
let path = {
build: {
html: project_folder + "/",
css: project_folder + "/css/",
js: project_folder + "/js/",
img: project_folder + "/img/",
fonts: project_folder + "/fonts/",
},
src: {
html: source_folder+ "/*.html",
css: source_folder+ "/scss/style.scss",
js: source_folder + "/js/script.js/",
img: source_folder + "/img/**/*.{jpg,png,svg,gif,ico,webp}",
fonts: source_folder + "/fonts/*.ttf",
},
watch: {
html: source_folder + "/**/*.html",
css: source_folder + "/scss/**/*.scss",
js: source_folder + "/js/**/*.js",
img: source_folder + "/img/**/*.{jpg,png,svg,gif,ico,webp}"
},
clean: "./" + project_folder + "/"
}
let { src, dest } = require('gulp'),
gulp = require('gulp'),
browsersync = require("browser-sync").create(),
fileinclude = require("gulp-file-include");
function browserSync(params) {
browsersync.init({
server: {
baseDir: "./" + project_folder + "/"
},
port: 3000,
notify: false
})
}
function html() {
return src(path.src.html)
.pipe(fileinclude())
.pipe(dest(path.build.html))
.pipe(browsersync.stream())
}
let build = gulp.series(html);
let watch = gulp.parallel(build, browserSync);
exports.html = html;
exports.build = build;
exports.watch = watch;
exports.default = watch;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
@@include('header.html')
<main class="main">
</main>
</body>
</html>
header.html:
<header class="header">
<h1>Шапка сайтаf</h1>
fdgg
</header>
package.json:
{
"name": "fls-gulp",
"version": "1.0.0",
"description": "Сборка gulp",
"main": "index.html",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Fls",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.26.12",
"gulp": "^4.0.2",
"gulp-file-include": "^2.2.2"
},
"dependencies": {}
}
Суть проблемы в том что когда я ввожу gulp, то у меня обнуляется index.html

