Skip to content

Commit

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

Please sign in to comment.