Skip to content

Commit 74fd573

Browse files
committed
Enhance bundling process in release script to resolve workspace package imports
1 parent 7b82e85 commit 74fd573

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/ddb-publisher/scripts/bundle-release.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ const outFile = resolve(outDir, "index.cjs");
2020
await rm(outDir, { recursive: true, force: true });
2121
await mkdir(dirname(outFile), { recursive: true });
2222

23-
// Ensure generated workspace packages (notably the schemas package) have been created
24-
// before bundling. In CI, `npm ci` alone isn't enough.
2523
await esbuild.build({
2624
absWorkingDir: repoRoot,
2725
entryPoints: [resolve(packageRoot, "src/cli.ts")],
@@ -42,6 +40,12 @@ await esbuild.build({
4240
define: {
4341
"import.meta.url": "globalThis.__IMPORT_META_URL__",
4442
},
43+
alias: {
44+
// In CI, the workspace package may not be built/linked into node_modules.
45+
// Alias it directly to the workspace directory so esbuild can resolve both
46+
// package-root imports and deep imports under `src/**`.
47+
"@nhsdigital/nhs-notify-event-schemas-supplier-config": "./packages/events",
48+
},
4549
});
4650

4751
// Add a small marker file to make the tarball contents obvious when debugging.

0 commit comments

Comments
 (0)