Skip to content

Commit 83b0838

Browse files
add suport for bun lockfile in monorepo (#337)
* add suport for bun lockfile in monorepo * changeset --------- Co-authored-by: Dorseuil Nicolas <[email protected]>
1 parent e773e67 commit 83b0838

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.changeset/dry-candles-chew.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+
add support for bun lockfile

packages/open-next/src/build.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ function findMonorepoRoot(appPath: string) {
170170
{ file: "package-lock.json", packager: "npm" as const },
171171
{ file: "yarn.lock", packager: "yarn" as const },
172172
{ file: "pnpm-lock.yaml", packager: "pnpm" as const },
173+
{ file: "bun.lockb", packager: "bun" as const },
173174
].find((f) => fs.existsSync(path.join(currentPath, f.file)));
174175

175176
if (found) {
@@ -201,11 +202,13 @@ function setStandaloneBuildMode(monorepoRoot: string) {
201202
process.env.NEXT_PRIVATE_OUTPUT_TRACE_ROOT = monorepoRoot;
202203
}
203204

204-
function buildNextjsApp(packager: "npm" | "yarn" | "pnpm") {
205+
function buildNextjsApp(packager: "npm" | "yarn" | "pnpm" | "bun") {
205206
const { nextPackageJsonPath } = options;
206207
const command =
207208
options.buildCommand ??
208-
(packager === "npm" ? "npm run build" : `${packager} build`);
209+
(["bun", "npm"].includes(packager)
210+
? `${packager} run build`
211+
: `${packager} build`);
209212
cp.execSync(command, {
210213
stdio: "inherit",
211214
cwd: path.dirname(nextPackageJsonPath),

0 commit comments

Comments
 (0)