Skip to content

Commit 46e9f48

Browse files
committed
add function to override next config
1 parent aa0c4ed commit 46e9f48

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/@apphosting/adapter-nextjs/src/bin/build.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ process.env.NEXT_TELEMETRY_DISABLED = "1";
2020
if (!process.env.FRAMEWORK_VERSION) {
2121
throw new Error("Could not find the nextjs version of the application");
2222
}
23+
24+
const { distDir, configFileName } = await loadConfig(root, opts.projectDirectory);
25+
2326
await runBuild();
2427

2528
const adapterMetadata = getAdapterMetadata();
26-
27-
const { distDir } = await loadConfig(root, opts.projectDirectory);
2829
const nextBuildDirectory = join(opts.projectDirectory, distDir);
2930
const outputBundleOptions = populateOutputBundleOptions(
3031
root,

packages/@apphosting/adapter-nextjs/src/overrides.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { AdapterMetadata, MiddlewareManifest } from "./interfaces.js";
22
import { loadRouteManifest, writeRouteManifest, loadMiddlewareManifest } from "./utils.js";
33

4+
export async function overrideNextConfig(nextConfigFileName: string) {}
5+
46
/**
57
* Modifies the app's route manifest (routes-manifest.json) to add Firebase App Hosting
68
* specific overrides (i.e headers).
@@ -36,8 +38,8 @@ export async function addRouteOverrides(
3638
]
3739
: []),
3840
],
39-
/*
40-
NextJs converts the source string to a regex using path-to-regexp (https://github.com/pillarjs/path-to-regexp) at
41+
/*
42+
NextJs converts the source string to a regex using path-to-regexp (https://github.com/pillarjs/path-to-regexp) at
4143
build time: https://github.com/vercel/next.js/blob/canary/packages/next/src/build/index.ts#L1273.
4244
This regex is then used to match the route against the request path.
4345

0 commit comments

Comments
 (0)