fix(bgm): pass options arg to buildStart in unit test

Vite 8 (rolldown) changed buildStart to take (this, options), so the
test's one-arg call failed typecheck. Add an ambient declaration for the
fixture's virtual bgm modules so its entry typechecks in the editor.
This commit is contained in:
2026-08-09 22:17:19 +08:00
parent 87e6eee9fe
commit b4cdcdeb42
2 changed files with 21 additions and 1 deletions
+3 -1
View File
@@ -80,7 +80,9 @@ describe('bgm vite plugin', () => {
const plugin = bgm({ root: gamesRoot });
const watched: string[] = [];
const context = { addWatchFile: (file: string) => watched.push(file) };
(plugin.buildStart as Callable<typeof plugin.buildStart>).call(context);
// Vite 8 (rolldown) `buildStart` takes `(this, options)`; the plugin ignores
// the options, so pass a placeholder.
(plugin.buildStart as Callable<typeof plugin.buildStart>).call(context, {} as never);
// Every def file (real + virtual code blocks) is watched so edits
// trigger a re-collect.