]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(ssr): avoid ast.helpers duplication (#6664)
authorAnthony Fu <anthonyfu117@hotmail.com>
Tue, 27 Sep 2022 09:06:24 +0000 (17:06 +0800)
committerGitHub <noreply@github.com>
Tue, 27 Sep 2022 09:06:24 +0000 (05:06 -0400)
packages/compiler-ssr/src/ssrCodegenTransform.ts

index 755862b52329d2abffefd81b8bc65216510dc0b0..4d142162073a2c5be269df15f55c2cbf450eaa9e 100644 (file)
@@ -48,9 +48,10 @@ export function ssrCodegenTransform(ast: RootNode, options: CompilerOptions) {
     context.body.push(
       createCompoundExpression([`const _cssVars = { style: `, varsExp, `}`])
     )
-    Array.from(cssContext.helpers.keys()).forEach(helper =>
-      ast.helpers.push(helper)
-    )
+    Array.from(cssContext.helpers.keys()).forEach(helper => {
+      if (!ast.helpers.includes(helper))
+        ast.helpers.push(helper)
+    })
   }
 
   const isFragment =