diff --git a/packages/next/src/server/dev/hot-reloader-types.ts b/packages/next/src/server/dev/hot-reloader-types.ts index f1988cf2b273d..4ad4e3b71ce26 100644 --- a/packages/next/src/server/dev/hot-reloader-types.ts +++ b/packages/next/src/server/dev/hot-reloader-types.ts @@ -6,7 +6,7 @@ import type getBaseWebpackConfig from '../../build/webpack-config' import type { RouteMatch } from '../future/route-matches/route-match' export interface NextJsHotReloaderInterface { - activeConfigs?: Array>> + activeWebpackConfigs?: Array>> serverStats: webpack.Stats | null edgeServerStats: webpack.Stats | null run( diff --git a/packages/next/src/server/dev/hot-reloader-webpack.ts b/packages/next/src/server/dev/hot-reloader-webpack.ts index ab92ed889ae76..e08cecbfe8fbe 100644 --- a/packages/next/src/server/dev/hot-reloader-webpack.ts +++ b/packages/next/src/server/dev/hot-reloader-webpack.ts @@ -211,7 +211,7 @@ export default class HotReloader implements NextJsHotReloaderInterface { public serverStats: webpack.Stats | null public edgeServerStats: webpack.Stats | null public multiCompiler?: webpack.MultiCompiler - public activeConfigs?: Array< + public activeWebpackConfigs?: Array< UnwrapPromise> > @@ -721,9 +721,9 @@ export default class HotReloader implements NextJsHotReloaderInterface { // Files outside of the distDir can be "type": "module" await fs.writeFile(distPackageJsonPath, '{"type": "commonjs"}') - this.activeConfigs = await this.getWebpackConfig(startSpan) + this.activeWebpackConfigs = await this.getWebpackConfig(startSpan) - for (const config of this.activeConfigs) { + for (const config of this.activeWebpackConfigs) { const defaultEntry = config.entry config.entry = async (...args) => { const outputPath = this.multiCompiler?.outputPath || '' @@ -995,10 +995,10 @@ export default class HotReloader implements NextJsHotReloaderInterface { // Enable building of client compilation before server compilation in development // @ts-ignore webpack 5 - this.activeConfigs.parallelism = 1 + this.activeWebpackConfigs.parallelism = 1 this.multiCompiler = webpack( - this.activeConfigs + this.activeWebpackConfigs ) as unknown as webpack.MultiCompiler // Copy over the filesystem so that it is shared between all compilers. @@ -1359,7 +1359,7 @@ export default class HotReloader implements NextJsHotReloaderInterface { this.watcher = await new Promise((resolve) => { const watcher = this.multiCompiler?.watch( // @ts-ignore webpack supports an array of watchOptions when using a multiCompiler - this.activeConfigs.map((config) => config.watchOptions!), + this.activeWebpackConfigs.map((config) => config.watchOptions!), // Errors are handled separately (_err: any) => { if (!booted) { diff --git a/packages/next/src/server/lib/router-utils/setup-dev.ts b/packages/next/src/server/lib/router-utils/setup-dev.ts index ec58ca706aa74..9f47e5caac0a6 100644 --- a/packages/next/src/server/lib/router-utils/setup-dev.ts +++ b/packages/next/src/server/lib/router-utils/setup-dev.ts @@ -610,7 +610,7 @@ async function startWatcher(opts: SetupOpts) { await writeOtherManifests() const turbopackHotReloader: NextJsHotReloaderInterface = { - activeConfigs: undefined, + activeWebpackConfigs: undefined, serverStats: null, edgeServerStats: null, async run(req, _res, _parsedUrl) { @@ -1199,7 +1199,7 @@ async function startWatcher(opts: SetupOpts) { } } - hotReloader.activeConfigs?.forEach((config, idx) => { + hotReloader.activeWebpackConfigs?.forEach((config, idx) => { const isClient = idx === 0 const isNodeServer = idx === 1 const isEdgeServer = idx === 2