From ada84998a3a61e4a173b4fb3a63fd7300d35d13d Mon Sep 17 00:00:00 2001 From: Janne Savolainen Date: Thu, 23 Feb 2023 10:13:03 +0200 Subject: [PATCH] Make multi export config for webpack not fail when used in windows Signed-off-by: Janne Savolainen --- .../webpack/src/get-multi-export-config.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/infrastructure/webpack/src/get-multi-export-config.js b/packages/infrastructure/webpack/src/get-multi-export-config.js index c784f63d57..338b3d89d7 100644 --- a/packages/infrastructure/webpack/src/get-multi-export-config.js +++ b/packages/infrastructure/webpack/src/get-multi-export-config.js @@ -60,7 +60,7 @@ module.exports = (packageJson, dependencies = { nodeConfig, reactConfig, joinPat const expectedExports = pipeline( packageJson.lensMultiExportConfig, keys, - map(toExpectedExportFor(dependencies)), + map(toExpectedExport), fromPairs ); @@ -79,8 +79,10 @@ module.exports = (packageJson, dependencies = { nodeConfig, reactConfig, joinPat ); }; -const toExpectedExportFor = (dependencies) => (externalImportPath) => { - const entrypointPath = `./${dependencies.joinPath( +const toExpectedExport = (externalImportPath) => { + const posixJoinForPackageJson = path.posix.join; + + const entrypointPath = `./${posixJoinForPackageJson( "./dist", externalImportPath, "index.js" @@ -89,7 +91,7 @@ const toExpectedExportFor = (dependencies) => (externalImportPath) => { return [ externalImportPath, { - types: `./${dependencies.joinPath("./dist", externalImportPath, "index.d.ts")}`, + types: `./${posixJoinForPackageJson("./dist", externalImportPath, "index.d.ts")}`, default: entrypointPath, import: entrypointPath,