Answer the question
In order to leave comments, you need to log in
How to copy a folder with html with internal structure in GULP?
Good afternoon,
for example, the src folder structure:
|__css
|__js
|__page
|____components
|____main
|______index.html
_____catalog
|______catalog.html
Please tell me
how to make the main folder simply copied with the entire internal structure?
(Except for the "components" folder, of course, which contains _header.html , _footer.html , etc...)
let project_folder = require("path").basename(__dirname);
let source_folder = "src";
let fs = require('fs');
let path = {
build: {
html: project_folder + basename,
},
src: {
html: [source_folder + "/page/**/*.html", "!" + source_folder + "/page/**/_*.html"],
},
watch: {
html: source_folder + "/**/*.html",
},
clean: "./" + project_folder + "/"
}
function html() {
return src(path.src.html)
.pipe(fileinclude())
.pipe(dest(path.build.html))
.pipe(browsersync.stream())
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question