]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(compiler-sfc): remove duplicate judgment conditions (#4368)
author似水微寒 <lhpmails@163.com>
Tue, 17 Aug 2021 16:12:18 +0000 (00:12 +0800)
committerGitHub <noreply@github.com>
Tue, 17 Aug 2021 16:12:18 +0000 (12:12 -0400)
packages/compiler-sfc/src/compileScript.ts

index 5289d110462580f2b7063037e6dfec45d1d9ea3b..68129564e1c5701ff8370c56c5af976fe0b7beb3 100644 (file)
@@ -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 {