Skip to content

Commit

Permalink
fix(language-core): don't default vueCompilerOptions.lib to `@vue/r…
Browse files Browse the repository at this point in the history
…untime-dom` for Vue 2
  • Loading branch information
johnsoncodehk committed Aug 29, 2024
1 parent 194e77c commit 92523f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/language-core/lib/utils/ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function getPartialVueCompilerOptions(

export function resolveVueCompilerOptions(vueOptions: Partial<VueCompilerOptions>): VueCompilerOptions {
const target = vueOptions.target ?? 3.3;
const lib = vueOptions.lib || (target < 2.7 ? '@vue/runtime-dom' : 'vue');
const lib = vueOptions.lib ?? 'vue';
return {
...vueOptions,
target,
Expand All @@ -222,7 +222,7 @@ export function resolveVueCompilerOptions(vueOptions: Partial<VueCompilerOptions
optionsWrapper: vueOptions.optionsWrapper ?? (
target >= 2.7
? [`(await import('${lib}')).defineComponent(`, `)`]
: [`(await import('vue')).default.extend(`, `)`]
: [`(await import('${lib}')).default.extend(`, `)`]
),
macros: {
defineProps: ['defineProps'],
Expand Down
2 changes: 1 addition & 1 deletion packages/language-core/schemas/vue-tsconfig.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"lib": {
"default": "vue",
"markdownDescription": "Specify module name for import regular types. (If empty, will use `@vue/runtime-dom` for target < 2.7, `vue` for target >= 2.7)"
"markdownDescription": "Specify module name for import regular types."
},
"jsxSlots": {
"type": "boolean",
Expand Down

0 comments on commit 92523f2

Please sign in to comment.