From c51fb74599d777b9648ea11dd6fe52abf49b943b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=BC=E6=B0=B4=E5=BE=AE=E5=AF=92?= Date: Wed, 18 Aug 2021 00:12:18 +0800 Subject: [PATCH] refactor(compiler-sfc): remove duplicate judgment conditions (#4368) --- packages/compiler-sfc/src/compileScript.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 5289d110..68129564 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/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 {