From 4954de44f337e346e168b9d635e01240d1ae2100 Mon Sep 17 00:00:00 2001 From: Mohit Singh Date: Sat, 10 Jan 2026 09:42:33 +0000 Subject: [PATCH 1/2] docs:changed output config examples to ESM --- src/content/configuration/output.mdx | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/content/configuration/output.mdx b/src/content/configuration/output.mdx index f44c0ce81e44..71cc32f58b33 100644 --- a/src/content/configuration/output.mdx +++ b/src/content/configuration/output.mdx @@ -52,10 +52,9 @@ Create async chunks that are loaded on demand. **webpack.config.js** ```javascript -module.exports = { +export default { //... output: { - //... asyncChunks: true, }, }; @@ -145,10 +144,9 @@ By default `[id].js` is used or a value inferred from [`output.filename`](#outpu **webpack.config.js** ```javascript -module.exports = { +export default { //... output: { - //... chunkFilename: '[id].js', }, }; @@ -200,10 +198,9 @@ The Number of milliseconds before chunk request expires. This option is supporte **webpack.config.js** ```javascript -module.exports = { +export default { //... output: { - //... chunkLoadTimeout: 30000, }, }; @@ -218,10 +215,9 @@ The global variable is used by webpack for loading chunks. **webpack.config.js** ```javascript -module.exports = { +export default { //... output: { - //... chunkLoadingGlobal: 'myCustomFunc', }, }; @@ -238,10 +234,9 @@ T> The default value of this option depends on the [`target`](/configuration/tar **webpack.config.js** ```javascript -module.exports = { +export default { //... output: { - //... chunkLoading: 'async-node', }, }; @@ -254,7 +249,7 @@ module.exports = { `boolean` `{ dry?: boolean, keep?: RegExp | string | ((filename: string) => boolean) }` ```javascript -module.exports = { +export default { //... output: { clean: true, // Clean the output directory before emit. @@ -263,7 +258,7 @@ module.exports = { ``` ```javascript -module.exports = { +export default { //... output: { clean: { @@ -274,7 +269,7 @@ module.exports = { ``` ```javascript -module.exports = { +export default { //... output: { clean: { @@ -317,7 +312,7 @@ Tells webpack to check if to be emitted file already exists and has the same con W> webpack will not write output file when file already exists on disk with the same content. ```javascript -module.exports = { +export default { //... output: { compareBeforeEmit: false, @@ -819,7 +814,7 @@ T> Typically you don't need to change `output.hotUpdateMainFilename`. Tells webpack to add [IIFE](https://developer.mozilla.org/en-US/docs/Glossary/IIFE) wrapper around emitted code. ```javascript -module.exports = { +export default { //... output: { iife: true, @@ -838,7 +833,7 @@ Hide warnings from the browser console in production. This option does not affec **webpack.config.js** ```javascript -module.exports = { +export default { //... output: { ignoreBrowserWarnings: true, From a692b878743c9d21aa0f3e503904da0f01750c1c Mon Sep 17 00:00:00 2001 From: Mohit Singh Date: Sat, 10 Jan 2026 09:53:02 +0000 Subject: [PATCH 2/2] docs:following the pattern in code according to docs --- src/content/configuration/output.mdx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/content/configuration/output.mdx b/src/content/configuration/output.mdx index 71cc32f58b33..69d7ae7428c7 100644 --- a/src/content/configuration/output.mdx +++ b/src/content/configuration/output.mdx @@ -55,6 +55,7 @@ Create async chunks that are loaded on demand. export default { //... output: { + //... asyncChunks: true, }, }; @@ -147,6 +148,7 @@ By default `[id].js` is used or a value inferred from [`output.filename`](#outpu export default { //... output: { + //... chunkFilename: '[id].js', }, }; @@ -201,6 +203,7 @@ The Number of milliseconds before chunk request expires. This option is supporte export default { //... output: { + //... chunkLoadTimeout: 30000, }, }; @@ -218,6 +221,7 @@ The global variable is used by webpack for loading chunks. export default { //... output: { + //... chunkLoadingGlobal: 'myCustomFunc', }, }; @@ -237,6 +241,7 @@ T> The default value of this option depends on the [`target`](/configuration/tar export default { //... output: { + //... chunkLoading: 'async-node', }, };