From 4ac4ac3fd4e14bc192431150674941842c88ab45 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Mon, 27 Apr 2026 07:01:23 -0300 Subject: [PATCH] build(prepublish): make next build bundler configurable Allow the prepublish script to choose between webpack and turbopack using the OMNIROUTE_USE_TURBOPACK environment variable. This keeps the default build path explicit while making it possible to switch bundlers for packaging and release workflows without editing the script. --- scripts/prepublish.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/prepublish.ts b/scripts/prepublish.ts index 37a398986b..500c280526 100644 --- a/scripts/prepublish.ts +++ b/scripts/prepublish.ts @@ -128,7 +128,9 @@ if (existsSync(APP_DIR)) { // ── Step 3: Build Next.js ────────────────────────────────── console.log(" 🏗️ Building Next.js (standalone)..."); -execSync("npx next build", { +const nextBuildBundlerFlag = + process.env.OMNIROUTE_USE_TURBOPACK === "1" ? "--turbopack" : "--webpack"; +execSync(`npx next build ${nextBuildBundlerFlag}`, { cwd: ROOT, stdio: "inherit", env: {