Skip to content

Commit

Permalink
Remove deprecated webpack5 config option (#41667)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
styfle committed Oct 23, 2022
1 parent aca3e98 commit 9c7e8b6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
5 changes: 0 additions & 5 deletions packages/next/server/config-schema.ts
Expand Up @@ -439,11 +439,6 @@ const configSchema = {
isFunction: true,
errorMessage: 'must be a function that returns a Promise',
} as any,
future: {
additionalProperties: false,
properties: {},
type: 'object',
},
generateBuildId: {
isFunction: true,
errorMessage: 'must be a function that returns a Promise',
Expand Down
14 changes: 0 additions & 14 deletions packages/next/server/config-shared.ts
Expand Up @@ -233,12 +233,6 @@ export interface NextConfig extends Record<string, any> {
*/
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)
*/
Expand Down Expand Up @@ -405,13 +399,6 @@ export interface NextConfig extends Record<string, any> {
*/
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
* that are needed for deploying a production version of your application.
Expand Down Expand Up @@ -539,7 +526,6 @@ export const defaultConfig: NextConfig = {
i18n: null,
productionBrowserSourceMaps: false,
optimizeFonts: true,
webpack5: undefined,
excludeDefaultMomentLocales: true,
serverRuntimeConfig: {},
publicRuntimeConfig: {},
Expand Down
6 changes: 0 additions & 6 deletions packages/next/server/config.ts
Expand Up @@ -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)) {
Log.warn(
`\`relay\` has been moved out of \`experimental\` and into \`compiler\`. Please update your ${configFileName} file accordingly.`
Expand Down

0 comments on commit 9c7e8b6

Please sign in to comment.