Skip to content

Commit a6b87aa

Browse files
committed
fix comments
1 parent 80752b5 commit a6b87aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/nextjs/src/config/webpack.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export function constructWebpackConfigFunction(
5959
// we're building server or client, whether we're in dev, what version of webpack we're using, etc). Note that
6060
// `currentWebpackConfig` and `buildContext` are referred to as `config` and `options` in the nextjs docs.
6161
const newWebpackFunction = (incomingConfig: WebpackConfigObject, buildContext: BuildContext): WebpackConfigObject => {
62-
// clone to avoid mutability issues
6362
let newConfig = { ...incomingConfig };
6463

6564
// if we're building server code, store the webpack output path as an env variable, so we know where to look for the
@@ -208,7 +207,9 @@ function addFileToExistingEntryPoint(
208207
newEntryPoint = [currentEntryPoint, filepath];
209208
} else if (Array.isArray(currentEntryPoint)) {
210209
newEntryPoint = [...currentEntryPoint, filepath];
211-
} else {
210+
}
211+
// descriptor object (webpack 5+)
212+
else {
212213
const currentImportValue = currentEntryPoint.import;
213214
let newImportValue: string | string[];
214215

0 commit comments

Comments
 (0)