Skip to content

Commit

Permalink
fix(plugin-vue): enable ts in template when using tsx in dev mode (#1…
Browse files Browse the repository at this point in the history
…0180)
  • Loading branch information
LiZhequ committed Oct 13, 2022
1 parent 1e44c81 commit 9897d98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/plugin-vue/src/main.ts
Expand Up @@ -213,9 +213,11 @@ export async function transformMain(

// handle TS transpilation
let resolvedCode = output.join('\n')
const lang = descriptor.scriptSetup?.lang || descriptor.script?.lang

if (
(descriptor.script?.lang === 'ts' ||
descriptor.scriptSetup?.lang === 'ts') &&
lang &&
/tsx?$/.test(lang) &&
!descriptor.script?.src // only normal script can have src
) {
const { code, map } = await transformWithEsbuild(
Expand Down

0 comments on commit 9897d98

Please sign in to comment.