Skip to content

Commit 3ff8369

Browse files
committed
fix(compiler-sfc): only add decorators-legacy parser plugin when new decorators plugin is not used
1 parent 8edf4b3 commit 3ff8369

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
@@ -185,7 +185,12 @@ export function compileScript(
185185
)
186186
}
187187
if (options.babelParserPlugins) plugins.push(...options.babelParserPlugins)
188-
if (isTS) plugins.push('typescript', 'decorators-legacy')
188+
if (isTS) {
189+
plugins.push('typescript')
190+
if (plugins.includes('decorators')) {
191+
plugins.push('decorators-legacy')
192+
}
193+
}
189194

190195
if (!scriptSetup) {
191196
if (!script) {

0 commit comments

Comments
 (0)