Skip to content

Commit

Permalink
fix(dts): prevent vue/language-core from generating global types
Browse files Browse the repository at this point in the history
  • Loading branch information
Teages committed Oct 13, 2024
1 parent a0c1c7a commit 31e93f0
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/utils/vue-dts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ export async function getVueDeclarations(
break;
}
default: {
await emitVueTscLatest(vfs, opts.typescript.compilerOptions, srcFiles);
await emitVueTscLatest(
vfs,
opts.typescript.compilerOptions,
srcFiles,
opts.rootDir!,
);
}
}

Expand Down Expand Up @@ -173,6 +178,7 @@ async function emitVueTscLatest(
vfs: Map<string, string>,
compilerOptions: CompilerOptions,
srcFiles: string[],
rootDir: string,
) {
const { resolve: resolveModule } = await import("mlly");
const ts: typeof import("typescript") = await import("typescript").then(
Expand Down Expand Up @@ -213,8 +219,15 @@ async function emitVueTscLatest(
const vueLanguagePlugin = vueLanguageCore.createVueLanguagePlugin<string>(
ts,
options.options,
vueLanguageCore.resolveVueCompilerOptions({}),
(id) => id as string,
vueLanguageCore.createParsedCommandLineByJson(
ts,
ts.sys,
rootDir,
{},
undefined,
true,
).vueOptions,
(id) => id,
);
return [vueLanguagePlugin];
},
Expand Down

0 comments on commit 31e93f0

Please sign in to comment.