@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +8 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsnchn/buntastic",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "A simple static site generator built with Bun",
5
5
  "type": "module",
6
6
  "bin": {
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
- await build(false);
311
+ try {
312
+ await build(false);
313
+ } finally {
314
+ isBuilding = false;
315
+ }
309
316
  }, 100);
310
317
  };
311
318