From a11b9a23f5a52a766ee1bcb2025a9c422f77a720 Mon Sep 17 00:00:00 2001 From: Dmitriy Lazarev Date: Tue, 28 Feb 2023 14:54:46 +0400 Subject: [PATCH] Keep custom exports entry points Signed-off-by: Dmitriy Lazarev --- .changeset/tall-hats-talk.md | 5 +++++ packages/cli/src/lib/packager/productionPack.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/tall-hats-talk.md diff --git a/.changeset/tall-hats-talk.md b/.changeset/tall-hats-talk.md new file mode 100644 index 0000000000..b10af002f6 --- /dev/null +++ b/.changeset/tall-hats-talk.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Keep custom exports entry points in package.json diff --git a/packages/cli/src/lib/packager/productionPack.ts b/packages/cli/src/lib/packager/productionPack.ts index b91112216a..a26f4893d0 100644 --- a/packages/cli/src/lib/packager/productionPack.ts +++ b/packages/cli/src/lib/packager/productionPack.ts @@ -186,7 +186,7 @@ async function prepareExportsEntryPoints( return undefined; } const distFiles = await fs.readdir(distPath); - const outputExports = {} as Record>; + const outputExports = {} as Record>; const compatibilityWriters = new Array< (targetDir: string) => Promise @@ -195,6 +195,7 @@ async function prepareExportsEntryPoints( const entryPoints = readEntryPoints(pkg); for (const entryPoint of entryPoints) { if (!SCRIPT_EXTS.includes(entryPoint.ext)) { + outputExports[entryPoint.mount] = entryPoint.path; continue; } const exp = {} as Record;