diff --git a/.changeset/tasty-doors-switch.md b/.changeset/tasty-doors-switch.md new file mode 100644 index 0000000000..e35bf9cfa4 --- /dev/null +++ b/.changeset/tasty-doors-switch.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Explicitly set `exports: 'named'` for CJS builds, ensuring that they have e.g. `exports["default"] = catalogPlugin;` diff --git a/packages/cli/src/lib/builder/config.ts b/packages/cli/src/lib/builder/config.ts index 99d8e96498..f614581320 100644 --- a/packages/cli/src/lib/builder/config.ts +++ b/packages/cli/src/lib/builder/config.ts @@ -90,6 +90,7 @@ export async function makeRollupConfigs( chunkFileNames: `cjs/[name]-[hash].cjs.js`, format: 'commonjs', sourcemap: true, + exports: 'named', }); } if (options.outputs.has(Output.esm)) {