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(
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,