Unverified Commit 9c7e8b66 authored by Steven's avatar Steven Committed by GitHub

Remove deprecated `webpack5` config option (#41667)

This option doesn't do anything except print an error since Next.js 12,
so we can remove it. See previous upgrade guide:


https://github.com/vercel/next.js/blob/canary/docs/upgrading.md#upgrade-nextjs-version-to-12
parent aca3e989
...@@ -439,11 +439,6 @@ const configSchema = { ...@@ -439,11 +439,6 @@ const configSchema = {
isFunction: true, isFunction: true,
errorMessage: 'must be a function that returns a Promise', errorMessage: 'must be a function that returns a Promise',
} as any, } as any,
future: {
additionalProperties: false,
properties: {},
type: 'object',
},
generateBuildId: { generateBuildId: {
isFunction: true, isFunction: true,
errorMessage: 'must be a function that returns a Promise', errorMessage: 'must be a function that returns a Promise',
......
...@@ -233,12 +233,6 @@ export interface NextConfig extends Record<string, any> { ...@@ -233,12 +233,6 @@ export interface NextConfig extends Record<string, any> {
*/ */
redirects?: () => Promise<Redirect[]> redirects?: () => Promise<Redirect[]>
/**
* @deprecated This option has been removed as webpack 5 is now default
* @see [Next.js webpack 5 documentation](https://nextjs.org/docs/messages/webpack5) for upgrading guidance.
*/
webpack5?: false
/** /**
* @see [Moment.js locales excluded by default](https://nextjs.org/docs/upgrading#momentjs-locales-excluded-by-default) * @see [Moment.js locales excluded by default](https://nextjs.org/docs/upgrading#momentjs-locales-excluded-by-default)
*/ */
...@@ -405,13 +399,6 @@ export interface NextConfig extends Record<string, any> { ...@@ -405,13 +399,6 @@ export interface NextConfig extends Record<string, any> {
*/ */
httpAgentOptions?: { keepAlive?: boolean } httpAgentOptions?: { keepAlive?: boolean }
future?: {
/**
* @deprecated This option has been removed as webpack 5 is now default
*/
webpack5?: false
}
/** /**
* During a build, Next.js will automatically trace each page and its dependencies to determine all of the files * During a build, Next.js will automatically trace each page and its dependencies to determine all of the files
* that are needed for deploying a production version of your application. * that are needed for deploying a production version of your application.
...@@ -539,7 +526,6 @@ export const defaultConfig: NextConfig = { ...@@ -539,7 +526,6 @@ export const defaultConfig: NextConfig = {
i18n: null, i18n: null,
productionBrowserSourceMaps: false, productionBrowserSourceMaps: false,
optimizeFonts: true, optimizeFonts: true,
webpack5: undefined,
excludeDefaultMomentLocales: true, excludeDefaultMomentLocales: true,
serverRuntimeConfig: {}, serverRuntimeConfig: {},
publicRuntimeConfig: {}, publicRuntimeConfig: {},
......
...@@ -520,12 +520,6 @@ function assignDefaults(dir: string, userConfig: { [key: string]: any }) { ...@@ -520,12 +520,6 @@ function assignDefaults(dir: string, userConfig: { [key: string]: any }) {
} }
} }
if (result.webpack5 === false) {
throw new Error(
`Webpack 4 is no longer supported in Next.js. Please upgrade to webpack 5 by removing "webpack5: false" from ${configFileName}. https://nextjs.org/docs/messages/webpack5`
)
}
if (result.experimental && 'relay' in (result.experimental as any)) { if (result.experimental && 'relay' in (result.experimental as any)) {
Log.warn( Log.warn(
`\`relay\` has been moved out of \`experimental\` and into \`compiler\`. Please update your ${configFileName} file accordingly.` `\`relay\` has been moved out of \`experimental\` and into \`compiler\`. Please update your ${configFileName} file accordingly.`
......
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