Unverified Commit 8e34902f authored by fabb's avatar fabb Committed by GitHub

Update NextConfig type to not require experimental or future fields (#25517)

when typechecking next.config.js as described [in the docs](https://github.com/vercel/next.js/blob/canary/docs/basic-features/typescript.md#type-checking-nextconfigjs), an error would be thrown if `future` and `experimental` are missing. When using `Partial<>` in the type definition instead, it works as expected.

Fixes #25498

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## 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.

## Documentation / Examples

- [ ] Make sure the linting passes
parent a9725793
import { webpack } from 'next/dist/compiled/webpack/webpack'
import { NextConfig } from '../../../server/config'
import { NextConfigComplete } from '../../../server/config-shared'
import { base } from './blocks/base'
import { css } from './blocks/css'
import { ConfigurationContext, pipe } from './utils'
......@@ -24,7 +24,7 @@ export async function build(
assetPrefix: string
sassOptions: any
productionBrowserSourceMaps: boolean
future: NextConfig['future']
future: NextConfigComplete['future']
isCraCompat?: boolean
}
): Promise<webpack.Configuration> {
......
import { webpack } from 'next/dist/compiled/webpack/webpack'
import { NextConfig } from '../../../server/config'
import { NextConfigComplete } from '../../../server/config-shared'
export type ConfigurationContext = {
rootDirectory: string
......@@ -16,7 +16,7 @@ export type ConfigurationContext = {
sassOptions: any
productionBrowserSourceMaps: boolean
future: NextConfig['future']
future: NextConfigComplete['future']
isCraCompat?: boolean
}
......
......@@ -46,7 +46,7 @@ interface ExportPageInput {
pagesDataDir: string
renderOpts: RenderOpts
buildExport?: boolean
serverRuntimeConfig: string
serverRuntimeConfig: { [key: string]: any }
subFolders?: boolean
serverless: boolean
optimizeFonts: boolean
......
......@@ -62,15 +62,18 @@ export type NextConfig = { [key: string]: any } & {
sassOptions?: { [key: string]: any }
productionBrowserSourceMaps?: boolean
optimizeFonts?: boolean
reactStrictMode?: boolean
publicRuntimeConfig?: { [key: string]: any }
serverRuntimeConfig?: { [key: string]: any }
future: {
future?: {
/**
* @deprecated this options was moved to the top level
*/
webpack5?: false
strictPostcssConfiguration?: boolean
}
experimental: {
experimental?: {
cpus?: number
plugins?: boolean
profiling?: 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