Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated webpack5 config option #41667

Merged
merged 4 commits into from Oct 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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