Merge pull request #25321 from backstage/blam/fix-package-bundling

Fix subpath bundling issues
This commit is contained in:
Ben Lambert
2024-06-19 16:05:04 +02:00
committed by GitHub
3 changed files with 13 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-defaults': patch
---
Repack the package to fix issues with typescript with named exports
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Subpath export `package.json` should be of a unique name to avoid typescript resolution issues
@@ -180,7 +180,9 @@ async function prepareExportsEntryPoints(
await fs.writeJson(
resolvePath(entryPointDir, PKG_PATH),
{
name: pkg.name,
// Need a temporary name, as sharing the same name causes some typescript issues with caching of packages names
// And their defined `types` field.
name: `${pkg.name}__${entryPoint.name.toLocaleLowerCase('en-US')}`,
version: pkg.version,
...(exp.default ? { main: posixPath.join('..', exp.default) } : {}),
...(exp.import ? { module: posixPath.join('..', exp.import) } : {}),