Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(compiler-sfc): only add decorators-legacy parser plugin when new …
…decorators plugin is not used
  • Loading branch information
yyx990803 committed Jun 30, 2022
1 parent 8edf4b3 commit 3ff8369
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/compiler-sfc/src/compileScript.ts
Expand Up @@ -185,7 +185,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) {
Expand Down

0 comments on commit 3ff8369

Please sign in to comment.