fix(compiler-sfc): only add decorators-legacy parser plugin when new decorators plugin is not used

This commit is contained in:
Evan You 2022-06-30 10:39:14 +08:00
parent 8edf4b3441
commit 3ff83694f5

View File

@ -185,7 +185,12 @@ export function compileScript(
) )
} }
if (options.babelParserPlugins) plugins.push(...options.babelParserPlugins) 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 (!scriptSetup) {
if (!script) { if (!script) {