gulp: build before watch

This commit is contained in:
2025-01-04 18:31:18 +08:00
parent c9002f4405
commit ab8e6b57f9

View File

@@ -70,11 +70,14 @@ async function clean() {
}
}
const task = gulp.series(clean, buildAll);
// Watch for file changes and rebuild
export function watch() {
export async function watch() {
await task();
console.log('Watching for changes...');
gulp.watch(SRC_DIR + '/**/*', gulp.series(clean, buildAll));
await gulp.watch(SRC_DIR + '/**/*', task);
}
// Export tasks for Gulp
export default gulp.series(clean, buildAll); // Default task
export default task; // Default task