Просмотр исходного кода

refactor(compiler-sfc): remove duplicate judgment conditions (#4368)

似水微寒 4 лет назад
Родитель
Сommit
c51fb74599
1 измененных файлов с 6 добавлено и 8 удалено
  1. 6 8
      packages/compiler-sfc/src/compileScript.ts

+ 6 - 8
packages/compiler-sfc/src/compileScript.ts

@@ -201,14 +201,12 @@ export function compileScript(
       let content = script.content
       if (cssVars.length) {
         content = rewriteDefault(content, `__default__`, plugins)
-        if (cssVars.length) {
-          content += genNormalScriptCssVarsCode(
-            cssVars,
-            bindings,
-            scopeId,
-            !!options.isProd
-          )
-        }
+        content += genNormalScriptCssVarsCode(
+          cssVars,
+          bindings,
+          scopeId,
+          !!options.isProd
+        )
         content += `\nexport default __default__`
       }
       return {