From c7e19a578088d8d4858fe80542f8b6fd2f3b2f0b Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Fri, 21 Feb 2025 15:47:13 +0100 Subject: [PATCH] CB-6249 No icons in the app for windows builds (#3267) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * CB-6249 fixes adding assets to the build for windows machines * СB-6249 fixes the path for windows * CB-6249 normalizes paths for build assets * CB-6249 adds comment for assets * CB-6249 normalizes paths to posix format --------- Co-authored-by: Evgenia <139753579+EvgeniaBzzz@users.noreply.github.com> --- .../product-base/src/copy-assets/copyAssetsPlugin.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webapp/packages/product-base/src/copy-assets/copyAssetsPlugin.ts b/webapp/packages/product-base/src/copy-assets/copyAssetsPlugin.ts index 5157973a4b..8713b7a1b1 100644 --- a/webapp/packages/product-base/src/copy-assets/copyAssetsPlugin.ts +++ b/webapp/packages/product-base/src/copy-assets/copyAssetsPlugin.ts @@ -16,8 +16,15 @@ import { getAssets } from './getAssets.js'; export function copyAssetsPlugin(): Plugin { // let rootPath = fileURLToPath(import.meta.url); + const assets = getAssets(fs.join(process.cwd(), 'package.json')); + const normalizedAssets = assets.map(asset => + fs + .normalize(`${asset}/**`) + // the DynamicPublicDirectory plugin expects paths to be in posix format (to include images and fonts for windows) + .replace(/\\/g, '/'), + ); - return DynamicPublicDirectory(getAssets(fs.join(process.cwd(), 'package.json')).map(v => `${v}/**`)) as any; + return DynamicPublicDirectory(normalizedAssets) as any; // return { // name: 'copy-assets', // configResolved(config) {