Skip to content

Commit

Permalink
Add missing fields to NextConfig type (#27974)
Browse files Browse the repository at this point in the history
This PR adds the `poweredByHeader` and `webpack` fields to the public `NextConfig` type.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
  • Loading branch information
stefanprobst committed Aug 12, 2021
1 parent 06e08ac commit 9bf3225
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/build/entries.ts
Expand Up @@ -91,7 +91,7 @@ export function createEntrypoints(
buildId,
assetPrefix: config.assetPrefix,
generateEtags: config.generateEtags ? 'true' : '',
poweredByHeader: config.poweredByHeader,
poweredByHeader: config.poweredByHeader ? 'true' : '',
canonicalBase: config.amp.canonicalBase || '',
basePath: config.basePath,
runtimeConfig: hasRuntimeConfig
Expand Down
17 changes: 17 additions & 0 deletions packages/next/server/config-shared.ts
Expand Up @@ -48,6 +48,22 @@ export type NextConfig = { [key: string]: any } & {
webpack5?: false
excludeDefaultMomentLocales?: boolean

webpack?:
| ((
config: any,
context: {
dir: string
dev: boolean
isServer: boolean
buildId: string
config: NextConfigComplete
defaultLoaders: { babel: any }
totalPages: number
webpack: any
}
) => any)
| null

trailingSlash?: boolean
env?: { [key: string]: string }
distDir?: string
Expand All @@ -58,6 +74,7 @@ export type NextConfig = { [key: string]: any } & {
generateEtags?: boolean
pageExtensions?: string[]
compress?: boolean
poweredByHeader?: boolean
images?: ImageConfig
devIndicators?: {
buildActivity?: boolean
Expand Down

0 comments on commit 9bf3225

Please sign in to comment.