From 9cfcb2d4f5fbb0f783b7f86b8e96b60b7304c477 Mon Sep 17 00:00:00 2001 From: Keshav Varadachari Date: Fri, 11 Feb 2022 09:30:40 -0500 Subject: [PATCH] build and copy if built css doesn't exist (#37632) --- build-system/tasks/extension-helpers.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build-system/tasks/extension-helpers.js b/build-system/tasks/extension-helpers.js index 0ebac4db3653..cd185977e73e 100644 --- a/build-system/tasks/extension-helpers.js +++ b/build-system/tasks/extension-helpers.js @@ -512,12 +512,11 @@ async function buildNpmBentoWebComponentCss(extDir, options) { const srcFilepath = path.resolve( `build/css/${getBentoName(options.name)}-${options.version}.css` ); - if (await fs.pathExists(srcFilepath)) { - const destFilepath = path.resolve(`${extDir}/dist/web-component.css`); - await fs.copyFile(srcFilepath, destFilepath); - } else { + if (!(await fs.pathExists(srcFilepath))) { await buildExtensionCss(extDir, options.name, options.version, options); } + const destFilepath = path.resolve(`${extDir}/dist/web-component.css`); + await fs.copyFile(srcFilepath, destFilepath); } /** @type {TransformCache} */