Skip to content

Commit

Permalink
fix(sfc): only include legacy decorator parser plugin when new plugin…
Browse files Browse the repository at this point in the history
… is not used
  • Loading branch information
yyx990803 committed Jun 30, 2022
1 parent 0ea6c36 commit d4b12c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/compiler-sfc/src/compileScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d4b12c4

Please sign in to comment.