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.
This commit is contained in:
diegosouzapw
2026-04-27 07:01:23 -03:00
parent cf0f947adb
commit 4ac4ac3fd4

View File

@@ -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: {