فهرست منبع

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

Anthony Fu 3 سال پیش
والد
کامیت
57ffc3e546
1فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  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(
     context.body.push(
       createCompoundExpression([`const _cssVars = { style: `, varsExp, `}`])
       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 =
   const isFragment =