Skip to content

Commit 9797602

Browse files
committed
add jsdocs
1 parent be9d381 commit 9797602

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import {
99
import { join } from "path";
1010
import { rename as renamePromise } from "fs/promises";
1111

12+
/**
13+
* Overrides the user's Next Config file (next.config.[ts|js|mjs]) to add configs
14+
* optimized for Firebase App Hosting.
15+
*/
1216
export async function overrideNextConfig(projectRoot: string, nextConfigFileName: string) {
1317
// Check if the file exists in the current working directory
1418
const configPath = join(projectRoot, nextConfigFileName);
@@ -52,6 +56,17 @@ export async function overrideNextConfig(projectRoot: string, nextConfigFileName
5256
}
5357
}
5458

59+
/**
60+
* Returns a custom Next.js config that optimizes the app for Firebase App Hosting.
61+
*
62+
* Current overrides include:
63+
* - images.unoptimized = true, unless user explicitly sets images.unoptimized to false or
64+
* is using a custom image loader.
65+
*
66+
* @param importStatement The import statement for the original config.
67+
* @param fileExtension The file extension of the original config.
68+
* @returns The custom Next.js config.
69+
*/
5570
function getCustomNextConfig(importStatement: string, fileExtension: string) {
5671
return `
5772
// @ts-nocheck

0 commit comments

Comments
 (0)