1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Make multi export config for webpack not fail when used in windows

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2023-02-23 10:13:03 +02:00
parent 5d21353493
commit ada84998a3
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A

View File

@ -60,7 +60,7 @@ module.exports = (packageJson, dependencies = { nodeConfig, reactConfig, joinPat
const expectedExports = pipeline( const expectedExports = pipeline(
packageJson.lensMultiExportConfig, packageJson.lensMultiExportConfig,
keys, keys,
map(toExpectedExportFor(dependencies)), map(toExpectedExport),
fromPairs fromPairs
); );
@ -79,8 +79,10 @@ module.exports = (packageJson, dependencies = { nodeConfig, reactConfig, joinPat
); );
}; };
const toExpectedExportFor = (dependencies) => (externalImportPath) => { const toExpectedExport = (externalImportPath) => {
const entrypointPath = `./${dependencies.joinPath( const posixJoinForPackageJson = path.posix.join;
const entrypointPath = `./${posixJoinForPackageJson(
"./dist", "./dist",
externalImportPath, externalImportPath,
"index.js" "index.js"
@ -89,7 +91,7 @@ const toExpectedExportFor = (dependencies) => (externalImportPath) => {
return [ return [
externalImportPath, externalImportPath,
{ {
types: `./${dependencies.joinPath("./dist", externalImportPath, "index.d.ts")}`, types: `./${posixJoinForPackageJson("./dist", externalImportPath, "index.d.ts")}`,
default: entrypointPath, default: entrypointPath,
import: entrypointPath, import: entrypointPath,