Skip to content

Commit

Permalink
Merge pull request #25321 from backstage/blam/fix-package-bundling
Browse files Browse the repository at this point in the history
Fix subpath bundling issues
  • Loading branch information
benjdlambert committed Jun 19, 2024
2 parents a934435 + cb14a05 commit 7862133
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/rare-peas-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/backend-defaults': patch
---

Repack the package to fix issues with typescript with named exports
5 changes: 5 additions & 0 deletions .changeset/silent-experts-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---

Subpath export `package.json` should be of a unique name to avoid typescript resolution issues
4 changes: 3 additions & 1 deletion packages/cli/src/lib/packager/productionPack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) } : {}),
Expand Down

0 comments on commit 7862133

Please sign in to comment.