@jsnchn/buntastic 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.ts +8 -1
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -300,12 +300,19 @@ async function dev(): Promise<void> {
|
|
|
300
300
|
|
|
301
301
|
const watchers = [watcher1, watcher2, watcher3];
|
|
302
302
|
|
|
303
|
+
let isBuilding = false;
|
|
303
304
|
let debounceTimer: ReturnType<typeof setTimeout> | undefined;
|
|
304
305
|
const rebuild = () => {
|
|
305
306
|
clearTimeout(debounceTimer);
|
|
306
307
|
debounceTimer = setTimeout(async () => {
|
|
308
|
+
if (isBuilding) return;
|
|
309
|
+
isBuilding = true;
|
|
307
310
|
console.log("Rebuilding...");
|
|
308
|
-
|
|
311
|
+
try {
|
|
312
|
+
await build(false);
|
|
313
|
+
} finally {
|
|
314
|
+
isBuilding = false;
|
|
315
|
+
}
|
|
309
316
|
}, 100);
|
|
310
317
|
};
|
|
311
318
|
|