Skip to content

Commit 326d24a

Browse files
committed
fix(sfc): only include legacy decorator parser plugin when new plugin is not used
1 parent 0ea6c36 commit 326d24a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/compiler-sfc/src/compileScript.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ export function compileScript(
126126
)
127127
}
128128
if (options.babelParserPlugins) plugins.push(...options.babelParserPlugins)
129-
if (isTS) plugins.push('typescript', 'decorators-legacy')
129+
if (isTS) {
130+
plugins.push('typescript')
131+
if (!plugins.includes('decorators')) {
132+
plugins.push('decorators-legacy')
133+
}
134+
}
130135

131136
if (!scriptSetup) {
132137
if (!script) {

0 commit comments

Comments
 (0)