Unverified Commit 1552b834 authored by 즈눅's avatar 즈눅 Committed by GitHub

Fix `generateBuildId` type that can be async function (#28040)

[The current documentation ensures it can be async function](https://github.com/vercel/next.js/blob/v11.1.1-canary.1/docs/api-reference/next.config.js/configuring-the-build-id.md?plain=1#L13), so this PR fixes the TypeScript type of it.
parent 6403a992
export async function generateBuildId( export async function generateBuildId(
generate: () => string | null, generate: () => string | null | Promise<string | null>,
fallback: () => string fallback: () => string
): Promise<string> { ): Promise<string> {
let buildId = await generate() let buildId = await generate()
......
...@@ -70,7 +70,7 @@ export type NextConfig = { [key: string]: any } & { ...@@ -70,7 +70,7 @@ export type NextConfig = { [key: string]: any } & {
cleanDistDir?: boolean cleanDistDir?: boolean
assetPrefix?: string assetPrefix?: string
useFileSystemPublicRoutes?: boolean useFileSystemPublicRoutes?: boolean
generateBuildId?: () => string | null generateBuildId?: () => string | null | Promise<string | null>
generateEtags?: boolean generateEtags?: boolean
pageExtensions?: string[] pageExtensions?: string[]
compress?: boolean compress?: boolean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment