From d753d3def052840d1c9661b6d42e1b7f4d99ad2d Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Mon, 14 Sep 2020 17:15:52 -0500 Subject: [PATCH 1/2] Update webpack 5 resolving --- packages/next/build/webpack-config.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 8f9753d16796..fa03ccb7290d 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -852,6 +852,18 @@ export default async function getBaseWebpackConfig( }, module: { rules: [ + ...(isWebpack5 + ? [ + // TODO: investigate optimal handling for this + // x-ref: https://github.com/webpack/webpack/issues/11467 + { + test: /\.m?js/, + resolve: { + fullySpecified: false, + }, + } as any, + ] + : []), { test: /\.(tsx|ts|js|mjs|jsx)$/, include: [dir, ...babelIncludeRegexes], From 16a5f3f0b38419f13741740ecb52ea93be322630 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Mon, 14 Sep 2020 23:06:08 -0400 Subject: [PATCH 2/2] Update packages/next/build/webpack-config.ts --- packages/next/build/webpack-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index fa03ccb7290d..780677c9f28b 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -854,7 +854,7 @@ export default async function getBaseWebpackConfig( rules: [ ...(isWebpack5 ? [ - // TODO: investigate optimal handling for this + // TODO: FIXME: do NOT webpack 5 support with this // x-ref: https://github.com/webpack/webpack/issues/11467 { test: /\.m?js/,