fix bounded standalone production build
Staging Backend Quality Gate / validate (push) Failing after 23m55s
Staging Backend Quality Gate / publish (push) Has been skipped

This commit is contained in:
Jesse_Chen
2026-08-09 20:37:02 +08:00
parent e1878ed511
commit 1db36b19b4
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "next dev",
"build": "next build",
"build": "next build --webpack",
"start": "next start",
"test": "tsx --test tests/*.test.ts",
"test:db": "tsx --test --test-concurrency=1 tests/database-*.test.ts",
@@ -87,6 +87,7 @@ const railwayWebDockerfile = new URL(
import.meta.url,
);
const nextConfig = new URL("../next.config.ts", import.meta.url);
const frontendPackage = new URL("../package.json", import.meta.url);
function read(url: URL): string {
return readFileSync(url, "utf8");
@@ -129,7 +130,9 @@ test("changed staging workflows are syntactically valid YAML", () => {
test("railway web image uses Next standalone runtime output", () => {
const dockerfile = read(railwayWebDockerfile);
const config = read(nextConfig);
const packageJson = JSON.parse(read(frontendPackage)) as { scripts?: { build?: string } };
assert.equal(packageJson.scripts?.build, "next build --webpack");
assert.match(config, /output: "standalone"/);
assert.match(config, /outputFileTracingRoot: repositoryRoot/);
assert.match(dockerfile, /RUN npm run build\n/);