gulp: build before watch
This commit is contained in:
@@ -70,11 +70,14 @@ async function clean() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const task = gulp.series(clean, buildAll);
|
||||||
|
|
||||||
// Watch for file changes and rebuild
|
// Watch for file changes and rebuild
|
||||||
export function watch() {
|
export async function watch() {
|
||||||
|
await task();
|
||||||
console.log('Watching for changes...');
|
console.log('Watching for changes...');
|
||||||
gulp.watch(SRC_DIR + '/**/*', gulp.series(clean, buildAll));
|
await gulp.watch(SRC_DIR + '/**/*', task);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export tasks for Gulp
|
// Export tasks for Gulp
|
||||||
export default gulp.series(clean, buildAll); // Default task
|
export default task; // Default task
|
||||||
|
|||||||
Reference in New Issue
Block a user