We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7082ccf commit babf67eCopy full SHA for babf67e
packages/plugin-vue/src/main.ts
@@ -306,10 +306,17 @@ async function genScriptCode(
306
(!script.lang || (script.lang === 'ts' && options.devServer)) &&
307
!script.src
308
) {
309
+ const userPlugins = options.script?.babelParserPlugins || []
310
+ const defaultPlugins =
311
+ script.lang === 'ts'
312
+ ? userPlugins.includes('decorators')
313
+ ? (['typescript'] as const)
314
+ : (['typescript', 'decorators-legacy'] as const)
315
+ : []
316
scriptCode = options.compiler.rewriteDefault(
317
script.content,
318
'_sfc_main',
- script.lang === 'ts' ? ['typescript'] : undefined
319
+ [...defaultPlugins, ...userPlugins]
320
)
321
map = script.map
322
} else {
0 commit comments