Open danny007in opened 3 years ago
Just make an filter to remove duplicate path, before sending to src
Any solution
Can i expect this issue will be solved,
I made a solution for this
gulp.task("build", function ()
{
let chunksPath = [];
let orgFilesPath = []
return gulp
// Get all source files.
.src("source/**/*.scss", { since: gulp.lastRun('build') })
// Add any dependent files to the stream.
.pipe(dependents(config, { logDependents: true, logDependencyMap: false }))
.pipe(through2.obj(function (chunk, enc, callback) {
let filePath = path.normalize(chunk.path);
if (!orgFilesPath.includes(filePath)) {
console.log("🚀 ~ file: gulpfile.js ~ line 95 ~ filePath", filePath)
this.push(chunk);
}
chunksPath.push(chunk)
for (const allChun of chunksPath) {
orgFilesPath.push(path.normalize(allChun.path))
}
callback()
}))
// For debugging, just output the name of each file we're about to build.
.pipe(debug({ title: "[build]" }));
});
main parts is
let chunksPath = [];
let orgFilesPath = []
.pipe(through2.obj(function (chunk, enc, callback) {
let filePath = path.normalize(chunk.path);
if (!orgFilesPath.includes(filePath)) {
console.log("🚀 ~ file: gulpfile.js ~ line 95 ~ filePath", filePath)
this.push(chunk);
}
chunksPath.push(chunk)
for (const allChun of chunksPath) {
orgFilesPath.push(path.normalize(allChun.path))
}
implement in main code
For example if save 4 multiple file on a time in folder it compile 4 times, but it has should compile only once
this is a wonderful devDep, plz solve this fast