From 69be5cbf2e1c61af9207dc61def2faa48afdb91c Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Mon, 8 Aug 2022 11:07:05 +0800 Subject: [PATCH 1/6] explain default value of output.chunkFormat and output.chunkLoading is inferred from target --- src/content/configuration/output.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content/configuration/output.mdx b/src/content/configuration/output.mdx index 671075aa0514..dcd622d23054 100644 --- a/src/content/configuration/output.mdx +++ b/src/content/configuration/output.mdx @@ -172,6 +172,8 @@ module.exports = { The format of chunks (formats included by default are `'array-push'` (web/WebWorker), `'commonjs'` (node.js), `'module'` (ESM), but others might be added by plugins). +T> The default value of this option is depending on the [`target`](/configuration/target/) and [`output.module`](#outputmodule) setting. For more details, search for `"workerChunkLoading"`: [in the webpack defaults](https://github.com/webpack/webpack/blob/master/lib/config/defaults.js). + **webpack.config.js** ```javascript @@ -226,6 +228,8 @@ module.exports = { The method to load chunks (methods included by default are `'jsonp'` (web), `'import'` (ESM), `'importScripts'` (WebWorker), `'require'` (sync node.js), `'async-node'` (async node.js), but others might be added by plugins). +T> The default value of this option is depending on the [`target`](/configuration/target/) setting. For more details, search for `"workerChunkLoading"`: [in the webpack defaults](https://github.com/webpack/webpack/blob/master/lib/config/defaults.js). + **webpack.config.js** ```javascript From f5a0adb4fc321c9df7ba64a593e6bd5498f68eba Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Mon, 8 Aug 2022 23:08:20 +0800 Subject: [PATCH 2/6] Update output.mdx --- src/content/configuration/output.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/configuration/output.mdx b/src/content/configuration/output.mdx index dcd622d23054..fededbcbbd07 100644 --- a/src/content/configuration/output.mdx +++ b/src/content/configuration/output.mdx @@ -172,7 +172,7 @@ module.exports = { The format of chunks (formats included by default are `'array-push'` (web/WebWorker), `'commonjs'` (node.js), `'module'` (ESM), but others might be added by plugins). -T> The default value of this option is depending on the [`target`](/configuration/target/) and [`output.module`](#outputmodule) setting. For more details, search for `"workerChunkLoading"`: [in the webpack defaults](https://github.com/webpack/webpack/blob/master/lib/config/defaults.js). +T> The default value of this option is depending on the [`target`](/configuration/target/) and [`output.module`](#outputmodule) setting. For more details, search for `"chunkFormat"`: [in the webpack defaults](https://github.com/webpack/webpack/blob/master/lib/config/defaults.js). **webpack.config.js** @@ -228,7 +228,7 @@ module.exports = { The method to load chunks (methods included by default are `'jsonp'` (web), `'import'` (ESM), `'importScripts'` (WebWorker), `'require'` (sync node.js), `'async-node'` (async node.js), but others might be added by plugins). -T> The default value of this option is depending on the [`target`](/configuration/target/) setting. For more details, search for `"workerChunkLoading"`: [in the webpack defaults](https://github.com/webpack/webpack/blob/master/lib/config/defaults.js). +T> The default value of this option is depending on the [`target`](/configuration/target/) setting. For more details, search for `"chunkLoading"`: [in the webpack defaults](https://github.com/webpack/webpack/blob/master/lib/config/defaults.js). **webpack.config.js** From 5dc41f7e5d1b96a4d628aa0f9025b6d9ee36d83b Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Tue, 9 Aug 2022 22:01:04 +0800 Subject: [PATCH 3/6] Update src/content/configuration/output.mdx Co-authored-by: Sam Chen --- src/content/configuration/output.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/configuration/output.mdx b/src/content/configuration/output.mdx index fededbcbbd07..ff242901940e 100644 --- a/src/content/configuration/output.mdx +++ b/src/content/configuration/output.mdx @@ -228,7 +228,7 @@ module.exports = { The method to load chunks (methods included by default are `'jsonp'` (web), `'import'` (ESM), `'importScripts'` (WebWorker), `'require'` (sync node.js), `'async-node'` (async node.js), but others might be added by plugins). -T> The default value of this option is depending on the [`target`](/configuration/target/) setting. For more details, search for `"chunkLoading"`: [in the webpack defaults](https://github.com/webpack/webpack/blob/master/lib/config/defaults.js). +T> The default value of this option depends on the [`target`](/configuration/target/) and [`chunkFormat `](#outputchunkformat) setting. For more details, search for `"chunkLoading"` [in the webpack defaults](https://github.com/webpack/webpack/blob/main/lib/config/defaults.js). **webpack.config.js** From 52ba4f9ae3dbbe5be6f860d680dddc83e03aa497 Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Tue, 9 Aug 2022 22:01:11 +0800 Subject: [PATCH 4/6] Update src/content/configuration/output.mdx Co-authored-by: Sam Chen --- src/content/configuration/output.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/configuration/output.mdx b/src/content/configuration/output.mdx index ff242901940e..7ac7c687c8e5 100644 --- a/src/content/configuration/output.mdx +++ b/src/content/configuration/output.mdx @@ -172,7 +172,7 @@ module.exports = { The format of chunks (formats included by default are `'array-push'` (web/WebWorker), `'commonjs'` (node.js), `'module'` (ESM), but others might be added by plugins). -T> The default value of this option is depending on the [`target`](/configuration/target/) and [`output.module`](#outputmodule) setting. For more details, search for `"chunkFormat"`: [in the webpack defaults](https://github.com/webpack/webpack/blob/master/lib/config/defaults.js). +T> The default value of this option depends on the [`target`](/configuration/target/) and [`output.module`](#outputmodule) setting. For more details, search for `"chunkFormat"` [in the webpack defaults](https://github.com/webpack/webpack/blob/main/lib/config/defaults.js). **webpack.config.js** From 77c2999769f92b37238c411bfe3d93a7e9955a26 Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Tue, 9 Aug 2022 22:02:12 +0800 Subject: [PATCH 5/6] Update output.mdx --- src/content/configuration/output.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/content/configuration/output.mdx b/src/content/configuration/output.mdx index 7ac7c687c8e5..c67c46db5744 100644 --- a/src/content/configuration/output.mdx +++ b/src/content/configuration/output.mdx @@ -357,7 +357,7 @@ module.exports = { }; ``` -The following substitutions are available in template strings (via webpack's internal [`ModuleFilenameHelpers`](https://github.com/webpack/webpack/blob/master/lib/ModuleFilenameHelpers.js)): +The following substitutions are available in template strings (via webpack's internal [`ModuleFilenameHelpers`](https://github.com/webpack/webpack/blob/main/lib/ModuleFilenameHelpers.js)): | Template | Description | | ------------------------ | --------------------------------------------------------------------------------------------------- | @@ -568,7 +568,7 @@ Note this option does not affect output files for on-demand-loaded chunks. It on ### Template strings -The following substitutions are available in template strings (via webpack's internal [`TemplatedPathPlugin`](https://github.com/webpack/webpack/blob/master/lib/TemplatedPathPlugin.js)): +The following substitutions are available in template strings (via webpack's internal [`TemplatedPathPlugin`](https://github.com/webpack/webpack/blob/main/lib/TemplatedPathPlugin.js)): Substitutions available on Compilation-level: @@ -868,7 +868,7 @@ In the above example, we're passing a single entry file to `entry`, however, web ``` - See [this example](https://github.com/webpack/webpack/tree/master/examples/multi-part-library) for more. + See [this example](https://github.com/webpack/webpack/tree/main/examples/multi-part-library) for more. Note that the above configuration won't work as expected if you're going to configure library options per entry point. Here is how to do it [under each of your entries](/concepts/entry-points/#entrydescription-object): @@ -2293,7 +2293,7 @@ module.exports = { The new option `workerChunkLoading` controls the chunk loading of workers. -T> The default value of this option is depending on the `target` setting. For more details, search for `"workerChunkLoading"`: [in the webpack defaults](https://github.com/webpack/webpack/blob/master/lib/config/defaults.js). +T> The default value of this option is depending on the `target` setting. For more details, search for `"workerChunkLoading"`: [in the webpack defaults](https://github.com/webpack/webpack/blob/main/lib/config/defaults.js). **webpack.config.js** From 1ca54de21f81512c289ca99543d51ea162d0f1db Mon Sep 17 00:00:00 2001 From: Sam Chen Date: Wed, 10 Aug 2022 12:22:04 +0800 Subject: [PATCH 6/6] Update src/content/configuration/output.mdx --- src/content/configuration/output.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/configuration/output.mdx b/src/content/configuration/output.mdx index c67c46db5744..63b07faa78f7 100644 --- a/src/content/configuration/output.mdx +++ b/src/content/configuration/output.mdx @@ -2293,7 +2293,7 @@ module.exports = { The new option `workerChunkLoading` controls the chunk loading of workers. -T> The default value of this option is depending on the `target` setting. For more details, search for `"workerChunkLoading"`: [in the webpack defaults](https://github.com/webpack/webpack/blob/main/lib/config/defaults.js). +T> The default value of this option depends on the [`target`](/configuration/target/) setting. For more details, search for `"workerChunkLoading"` [in the webpack defaults](https://github.com/webpack/webpack/blob/main/lib/config/defaults.js). **webpack.config.js**