Skip to content

Commit 2d9e538

Browse files
committed
Make package path available at runtime
1 parent ba84a00 commit 2d9e538

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.changeset/chilly-scissors-drum.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"open-next": patch
3+
---
4+
5+
Make package path available at runtime

packages/open-next/src/build.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ async function createServerBundle(monorepoRoot: string, streaming = false) {
613613
outfile: path.join(outputPath, packagePath, "index.mjs"),
614614
banner: {
615615
js: [
616+
`globalThis.monorepoPackagePath = "${packagePath}";`,
616617
"import { createRequire as topLevelCreateRequire } from 'module';",
617618
"const require = topLevelCreateRequire(import.meta.url);",
618619
"import bannerUrl from 'url';",

0 commit comments

Comments
 (0)