Skip to content

Commit 9897d98

Browse files
authored
fix(plugin-vue): enable ts in template when using tsx in dev mode (#10180)
1 parent 1e44c81 commit 9897d98

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/plugin-vue/src/main.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,11 @@ export async function transformMain(
213213

214214
// handle TS transpilation
215215
let resolvedCode = output.join('\n')
216+
const lang = descriptor.scriptSetup?.lang || descriptor.script?.lang
217+
216218
if (
217-
(descriptor.script?.lang === 'ts' ||
218-
descriptor.scriptSetup?.lang === 'ts') &&
219+
lang &&
220+
/tsx?$/.test(lang) &&
219221
!descriptor.script?.src // only normal script can have src
220222
) {
221223
const { code, map } = await transformWithEsbuild(

0 commit comments

Comments
 (0)