diff --git a/next.config.mjs b/next.config.mjs index a1a3fd5d7b..26303ced09 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -109,6 +109,8 @@ function filterKnownInfrastructureWarnings(baseConsole) { // The resulting artifact is intended to be published as `omniroute-secure` // for security-sensitive environments. See docs/security/SOCKET_DEV_FINDINGS.md. const isMinimalBuild = process.env.OMNIROUTE_BUILD_PROFILE === "minimal"; +// Contributor builds validate compilation only and do not need a shippable standalone bundle. +const isContributorBuild = process.env.OMNIROUTE_BUILD_PROFILE === "contributor"; // #10273: `null` unless the operator opts in with DASHBOARD_ALLOW_EMBED=vscode. Read at build // time like every other knob in this file (OMNIROUTE_BASE_PATH, OMNIROUTE_BUILD_PROFILE, …), @@ -218,7 +220,7 @@ const nextConfig = { }, ], }, - output: "standalone", + ...(isContributorBuild ? {} : { output: "standalone" }), compress: true, productionBrowserSourceMaps: false, // OmniRoute is a proxy for AI APIs — request bodies routinely include diff --git a/tests/unit/build/contributor-build-script.test.mjs b/tests/unit/build/contributor-build-script.test.mjs index 0161152c6d..52367b3c40 100644 --- a/tests/unit/build/contributor-build-script.test.mjs +++ b/tests/unit/build/contributor-build-script.test.mjs @@ -7,6 +7,8 @@ import { stubContributorInstrumentation, } from "../../../scripts/build/backendOnlyPages.mjs"; +const nextConfigSource = fs.readFileSync(path.join(process.cwd(), "next.config.mjs"), "utf8"); + const packageJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), "package.json"), "utf8")); test("contributor build profile selects the webpack fallback", () => { @@ -48,3 +50,11 @@ test("contributor instrumentation stubs are reversible", async () => { for (const [target, source] of originals) assert.equal(await fs.readFile(target, "utf8"), source); await fs.rm(tempRoot, { recursive: true, force: true }); }); + +test("contributor profile disables standalone output while default keeps it", () => { + assert.match(nextConfigSource, /isContributorBuild/); + assert.match( + nextConfigSource, + /\.\.\.\(isContributorBuild \? \{\} : \{ output: "standalone" \}\)/ + ); +});