当 Gulp Watch 只需要处理已修改的文件时,我遇到了问题
当我开始时,Gulp 会正确执行任务,但是当我进行更改时,Gulp 手表会再次执行所有任务,而不仅仅是那些已更改的任务。我不知道可能是什么问题,你能帮我吗?
// Watch Task: watch SCSS and JS files for changes
// If any change, run scss and js tasks simultaneously
function watchTask() {
watch([files.htmlPath, files.scssPath, files.mincssPath, files.cssPath, files.minjsPath, files.jsPath, files.imgPath],
parallel(htmlTask, siteTask, series(scssTask, cleanTask, concatCSS), series(jsminTask, jsTask), imgTask));
}
// Export the default Gulp task so it can be run
// Runs the scss and js tasks simultaneously
// then runs cacheBust, then watch task
exports.default = series(
parallel(htmlTask, siteTask, series(scssTask, cleanTask, concatCSS), series(jsminTask, jsTask), imgTask),
cacheBustTask,
watchTask
);