fix bounded standalone production build
This commit is contained in:
@@ -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/);
|
||||
|
||||
Reference in New Issue
Block a user