fix(sfc): only include legacy decorator parser plugin when new plugin is not used

This commit is contained in:
Evan You 2022-06-30 10:37:40 +08:00
parent 0ea6c366f5
commit 326d24a4e4

View File

@ -126,7 +126,12 @@ export function compileScript(
)
}
if (options.babelParserPlugins) plugins.push(...options.babelParserPlugins)
if (isTS) plugins.push('typescript', 'decorators-legacy')
if (isTS) {
plugins.push('typescript')
if (!plugins.includes('decorators')) {
plugins.push('decorators-legacy')
}
}
if (!scriptSetup) {
if (!script) {