Ver Fonte

fix(ssr): avoid ast.helpers duplication (#6664)

Anthony Fu há 3 anos atrás
pai
commit
57ffc3e546
1 ficheiros alterados com 4 adições e 3 exclusões
  1. 4 3
      packages/compiler-ssr/src/ssrCodegenTransform.ts

+ 4 - 3
packages/compiler-ssr/src/ssrCodegenTransform.ts

@@ -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 =