We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad6047d commit 5104ee8Copy full SHA for 5104ee8
packages/plugin-vue/src/main.ts
@@ -272,7 +272,15 @@ async function genScriptCode(
272
// If the script is js/ts and has no external src, it can be directly placed
273
// in the main module.
274
if ((!script.lang || script.lang === 'ts') && !script.src) {
275
- scriptCode = compiler.rewriteDefault(script.content, '_sfc_main')
+ scriptCode = compiler.rewriteDefault(
276
+ script.content,
277
+ '_sfc_main',
278
+ script.lang === 'ts'
279
+ ? ['typescript']
280
+ : script.lang === 'tsx'
281
+ ? ['typescript', 'jsx']
282
+ : undefined
283
+ )
284
map = script.map
285
} else {
286
if (script.src) {
0 commit comments