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
  • Loading branch information
LiZhequ authored Oct 13, 2022
1 parent c4489ea commit a9f9d31
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/plugin-vue/src/main.ts
Original file line number Diff line number Diff line change
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 a9f9d31

Please sign in to comment.