Skip to content

Commit

Permalink
fix(plugin-vue): enable ts in template also for lang=tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Sep 20, 2021
1 parent 4ff5b9b commit ed88df3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/plugin-vue/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,8 @@ export function resolveTemplateCompilerOptions(
// if using TS, support TS syntax in template expressions
const expressionPlugins: CompilerOptions['expressionPlugins'] =
options.template?.compilerOptions?.expressionPlugins || []
if (
descriptor.script?.lang === 'ts' ||
descriptor.scriptSetup?.lang === 'ts'
) {
const lang = descriptor.scriptSetup?.lang || descriptor.script?.lang
if (lang && /tsx?$/.test(lang) && !expressionPlugins.includes('typescript')) {
expressionPlugins.push('typescript')
}

Expand Down

0 comments on commit ed88df3

Please sign in to comment.