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:
parent
5d21353493
commit
ada84998a3
@ -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,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user