vue-micro-router 1.0.8 → 1.0.10

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.
@@ -62,9 +62,9 @@ if (!scanDir) {
62
62
  }
63
63
  const SCAN_PATH = resolve(CWD, scanDir);
64
64
 
65
- // Auto-detect output — put in scan dir if it's src/app, else root
65
+ // Always output to project root avoids Vite HMR loop when inside src/
66
66
  if (!outputFile) {
67
- outputFile = scanDir !== '.' ? `${scanDir}/vue-micro-router.d.ts` : 'vue-micro-router.d.ts';
67
+ outputFile = 'vue-micro-router.d.ts';
68
68
  }
69
69
 
70
70
  console.log(`Scan: ${scanDir}/`);
@@ -296,13 +296,10 @@ if (watchMode) {
296
296
  }, 300);
297
297
  };
298
298
 
299
- const outputBasename = outputFile.split('/').pop();
300
-
301
299
  fsWatch(SCAN_PATH, { recursive: true }, (event, filename) => {
302
300
  if (!filename) return;
303
- // Skip output file to prevent infinite loop
304
- if (filename.endsWith(outputBasename)) return;
305
- const ext = extname(filename);
306
- if (ext === '.vue' || ext === '.ts') regenerate();
301
+ // Skip .d.ts files (output file, auto-imports.d.ts, etc.) only watch source
302
+ if (filename.endsWith('.d.ts')) return;
303
+ if (filename.endsWith('.vue') || filename.endsWith('.ts')) regenerate();
307
304
  });
308
305
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-micro-router",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "type": "module",
5
5
  "description": "Mobile-app-style navigation for Vue 3 — animated page stacks, modal dialogs, HUD controls. No URL routing.",
6
6
  "author": {