Skip to content

Commit

Permalink
Make package path available at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
fwang committed Oct 11, 2023
1 parent ba84a00 commit 2d9e538
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-scissors-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"open-next": patch
---

Make package path available at runtime
1 change: 1 addition & 0 deletions packages/open-next/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ async function createServerBundle(monorepoRoot: string, streaming = false) {
outfile: path.join(outputPath, packagePath, "index.mjs"),
banner: {
js: [
`globalThis.monorepoPackagePath = "${packagePath}";`,
"import { createRequire as topLevelCreateRequire } from 'module';",
"const require = topLevelCreateRequire(import.meta.url);",
"import bannerUrl from 'url';",
Expand Down

1 comment on commit 2d9e538

@vercel
Copy link

@vercel vercel bot commented on 2d9e538 Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

open-next – ./

open-next.vercel.app
open-next-sst-dev.vercel.app
open-next-git-main-sst-dev.vercel.app

Please sign in to comment.