From 75c6416cfe95217b5ce60d02ba5d24d88c50f538 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Mon, 7 May 2018 12:36:38 +0200 Subject: [PATCH] updated examples --- examples/aggressive-merging/README.md | 100 ++++---- examples/chunkhash/README.md | 43 ++-- .../README.md | 69 ++--- .../code-splitted-require.context/README.md | 69 ++--- .../code-splitting-bundle-loader/README.md | 41 +-- examples/code-splitting-harmony/README.md | 37 +-- .../README.md | 81 +++--- .../README.md | 81 +++--- .../README.md | 81 +++--- examples/code-splitting/README.md | 25 +- examples/coffee-script/README.md | 32 +-- .../common-chunk-and-vendor-chunk/README.md | 76 +++--- examples/common-chunk-grandchildren/README.md | 69 ++--- examples/commonjs/README.md | 28 +-- .../dll-app-and-vendor/0-vendor/README.md | 20 +- examples/dll-app-and-vendor/1-app/README.md | 52 ++-- examples/dll-user/README.md | 124 ++++----- examples/dll/README.md | 92 +++---- examples/explicit-vendor-chunk/README.md | 114 ++++----- examples/externals/README.md | 28 +-- examples/extra-async-chunk-advanced/README.md | 105 ++++---- examples/extra-async-chunk/README.md | 65 ++--- examples/harmony-interop/README.md | 96 +++---- examples/harmony-library/README.md | 16 +- examples/harmony-unused/README.md | 90 +++---- examples/harmony/README.md | 83 +++--- examples/hybrid-routing/README.md | 113 +++++---- examples/i18n/README.md | 20 +- examples/loader/README.md | 40 +-- examples/mixed/README.md | 141 ++++++----- examples/multi-compiler/README.md | 28 +-- examples/multi-part-library/README.md | 20 +- examples/multiple-entry-points/README.md | 78 +++--- examples/named-chunks/README.md | 25 +- examples/require.context/README.md | 56 ++--- examples/require.resolve/README.md | 34 +-- examples/scope-hoisting/README.md | 109 ++++---- examples/side-effects/README.md | 24 +- examples/source-map/README.md | 72 +++--- examples/two-explicit-vendor-chunks/README.md | 116 ++++----- examples/wasm-simple/README.md | 237 +++++++++++------- examples/web-worker/README.md | 72 +++--- 42 files changed, 1544 insertions(+), 1358 deletions(-) diff --git a/examples/aggressive-merging/README.md b/examples/aggressive-merging/README.md index ff31b46d990..02c4c142264 100644 --- a/examples/aggressive-merging/README.md +++ b/examples/aggressive-merging/README.md @@ -60,94 +60,94 @@ module.exports = { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.chunk.js 5.98 KiB 0 [emitted] 1.chunk.js 405 bytes 1 [emitted] -pageC.bundle.js 7.05 KiB 2 [emitted] pageC -pageB.bundle.js 7.05 KiB 3 [emitted] pageB -pageA.bundle.js 7.05 KiB 4 [emitted] pageA +pageC.bundle.js 7.32 KiB 2 [emitted] pageC +pageB.bundle.js 7.32 KiB 3 [emitted] pageB +pageA.bundle.js 7.32 KiB 4 [emitted] pageA Entrypoint pageA = pageA.bundle.js Entrypoint pageB = pageB.bundle.js Entrypoint pageC = pageC.bundle.js chunk {0} 0.chunk.js 5.46 KiB <{3}> <{4}> [rendered] > ./common [4] ./pageB.js 1:0-3:2 > ./common [5] ./pageA.js 1:0-3:2 - [0] ./b.js 21 bytes {0} {1} [built] - cjs require ./b [3] ./pageC.js 2:17-31 - cjs require ./b [4] ./pageB.js 2:8-22 - [1] ./a.js 21 bytes {0} {1} [built] - amd require ./a [3] ./pageC.js 1:0-3:2 - cjs require ./a [5] ./pageA.js 2:8-22 - [2] ./common.js 5.42 KiB {0} [built] - amd require ./common [4] ./pageB.js 1:0-3:2 - amd require ./common [5] ./pageA.js 1:0-3:2 + [0] ./b.js 21 bytes {0} {1} [built] + cjs require ./b [3] ./pageC.js 2:17-31 + cjs require ./b [4] ./pageB.js 2:8-22 + [1] ./a.js 21 bytes {0} {1} [built] + amd require ./a [3] ./pageC.js 1:0-3:2 + cjs require ./a [5] ./pageA.js 2:8-22 + [2] ./common.js 5.42 KiB {0} [built] + amd require ./common [4] ./pageB.js 1:0-3:2 + amd require ./common [5] ./pageA.js 1:0-3:2 chunk {1} 1.chunk.js 42 bytes <{2}> [rendered] > ./a [3] ./pageC.js 1:0-3:2 - [0] ./b.js 21 bytes {0} {1} [built] - cjs require ./b [3] ./pageC.js 2:17-31 - cjs require ./b [4] ./pageB.js 2:8-22 - [1] ./a.js 21 bytes {0} {1} [built] - amd require ./a [3] ./pageC.js 1:0-3:2 - cjs require ./a [5] ./pageA.js 2:8-22 + [0] ./b.js 21 bytes {0} {1} [built] + cjs require ./b [3] ./pageC.js 2:17-31 + cjs require ./b [4] ./pageB.js 2:8-22 + [1] ./a.js 21 bytes {0} {1} [built] + amd require ./a [3] ./pageC.js 1:0-3:2 + cjs require ./a [5] ./pageA.js 2:8-22 chunk {2} pageC.bundle.js (pageC) 70 bytes >{1}< [entry] [rendered] > ./pageC pageC - [3] ./pageC.js 70 bytes {2} [built] - single entry ./pageC pageC + [3] ./pageC.js 70 bytes {2} [built] + single entry ./pageC pageC chunk {3} pageB.bundle.js (pageB) 71 bytes >{0}< [entry] [rendered] > ./pageB pageB - [4] ./pageB.js 71 bytes {3} [built] - single entry ./pageB pageB + [4] ./pageB.js 71 bytes {3} [built] + single entry ./pageB pageB chunk {4} pageA.bundle.js (pageA) 71 bytes >{0}< [entry] [rendered] > ./pageA pageA - [5] ./pageA.js 71 bytes {4} [built] - single entry ./pageA pageA + [5] ./pageA.js 71 bytes {4} [built] + single entry ./pageA pageA ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.chunk.js 173 bytes 0, 1 [emitted] 1.chunk.js 118 bytes 1 [emitted] -pageC.bundle.js 1.67 KiB 2 [emitted] pageC -pageB.bundle.js 1.66 KiB 3 [emitted] pageB -pageA.bundle.js 1.66 KiB 4 [emitted] pageA +pageC.bundle.js 1.7 KiB 2 [emitted] pageC +pageB.bundle.js 1.69 KiB 3 [emitted] pageB +pageA.bundle.js 1.69 KiB 4 [emitted] pageA Entrypoint pageA = pageA.bundle.js Entrypoint pageB = pageB.bundle.js Entrypoint pageC = pageC.bundle.js chunk {0} 0.chunk.js 5.46 KiB <{3}> <{4}> [rendered] > ./common [4] ./pageB.js 1:0-3:2 > ./common [5] ./pageA.js 1:0-3:2 - [0] ./b.js 21 bytes {0} {1} [built] - cjs require ./b [3] ./pageC.js 2:17-31 - cjs require ./b [4] ./pageB.js 2:8-22 - [1] ./a.js 21 bytes {0} {1} [built] - amd require ./a [3] ./pageC.js 1:0-3:2 - cjs require ./a [5] ./pageA.js 2:8-22 - [2] ./common.js 5.42 KiB {0} [built] - amd require ./common [4] ./pageB.js 1:0-3:2 - amd require ./common [5] ./pageA.js 1:0-3:2 + [0] ./b.js 21 bytes {0} {1} [built] + cjs require ./b [3] ./pageC.js 2:17-31 + cjs require ./b [4] ./pageB.js 2:8-22 + [1] ./a.js 21 bytes {0} {1} [built] + amd require ./a [3] ./pageC.js 1:0-3:2 + cjs require ./a [5] ./pageA.js 2:8-22 + [2] ./common.js 5.42 KiB {0} [built] + amd require ./common [4] ./pageB.js 1:0-3:2 + amd require ./common [5] ./pageA.js 1:0-3:2 chunk {1} 1.chunk.js 42 bytes <{2}> [rendered] > ./a [3] ./pageC.js 1:0-3:2 - [0] ./b.js 21 bytes {0} {1} [built] - cjs require ./b [3] ./pageC.js 2:17-31 - cjs require ./b [4] ./pageB.js 2:8-22 - [1] ./a.js 21 bytes {0} {1} [built] - amd require ./a [3] ./pageC.js 1:0-3:2 - cjs require ./a [5] ./pageA.js 2:8-22 + [0] ./b.js 21 bytes {0} {1} [built] + cjs require ./b [3] ./pageC.js 2:17-31 + cjs require ./b [4] ./pageB.js 2:8-22 + [1] ./a.js 21 bytes {0} {1} [built] + amd require ./a [3] ./pageC.js 1:0-3:2 + cjs require ./a [5] ./pageA.js 2:8-22 chunk {2} pageC.bundle.js (pageC) 70 bytes >{1}< [entry] [rendered] > ./pageC pageC - [3] ./pageC.js 70 bytes {2} [built] - single entry ./pageC pageC + [3] ./pageC.js 70 bytes {2} [built] + single entry ./pageC pageC chunk {3} pageB.bundle.js (pageB) 71 bytes >{0}< [entry] [rendered] > ./pageB pageB - [4] ./pageB.js 71 bytes {3} [built] - single entry ./pageB pageB + [4] ./pageB.js 71 bytes {3} [built] + single entry ./pageB pageB chunk {4} pageA.bundle.js (pageA) 71 bytes >{0}< [entry] [rendered] > ./pageA pageA - [5] ./pageA.js 71 bytes {4} [built] - single entry ./pageA pageA + [5] ./pageA.js 71 bytes {4} [built] + single entry ./pageA pageA ``` diff --git a/examples/chunkhash/README.md b/examples/chunkhash/README.md index 68bf052d072..e02b81676dc 100644 --- a/examples/chunkhash/README.md +++ b/examples/chunkhash/README.md @@ -45,7 +45,7 @@ module.exports = { @@ -112,12 +112,19 @@ module.exports = { /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 3: 0 /******/ }; /******/ /******/ var deferredModules = []; /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + ({}[chunkId]||chunkId) + ".[chunkhash].js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -173,7 +180,7 @@ module.exports = { /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + ({}[chunkId]||chunkId) + ".[chunkhash].js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -287,25 +294,25 @@ __webpack_require__.e(/*! import() */ 2).then(function() { var module = __webpac ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names main.[chunkhash].js 877 bytes 0 [emitted] main 1.[chunkhash].js 270 bytes 1 [emitted] 2.[chunkhash].js 264 bytes 2 [emitted] -runtime~main.[chunkhash].js 7.48 KiB 3 [emitted] runtime~main +runtime~main.[chunkhash].js 7.75 KiB 3 [emitted] runtime~main Entrypoint main = runtime~main.[chunkhash].js main.[chunkhash].js chunk {0} main.[chunkhash].js (main) 55 bytes ={3}= >{1}< >{2}< [initial] [rendered] > ./example main - [0] ./example.js 55 bytes {0} [built] - single entry ./example main + [0] ./example.js 55 bytes {0} [built] + single entry ./example main chunk {1} 1.[chunkhash].js 29 bytes <{0}> <{3}> [rendered] > ./async1 [0] ./example.js 2:0-18 - [1] ./async1.js 29 bytes {1} [built] - import() ./async1 [0] ./example.js 2:0-18 + [1] ./async1.js 29 bytes {1} [built] + import() ./async1 [0] ./example.js 2:0-18 chunk {2} 2.[chunkhash].js 29 bytes <{0}> <{3}> [rendered] > ./async2 [0] ./example.js 3:0-18 - [2] ./async2.js 29 bytes {2} [built] - import() ./async2 [0] ./example.js 3:0-18 + [2] ./async2.js 29 bytes {2} [built] + import() ./async2 [0] ./example.js 3:0-18 chunk {3} runtime~main.[chunkhash].js (runtime~main) 0 bytes ={0}= >{1}< >{2}< [entry] [rendered] > ./example main ``` @@ -314,25 +321,25 @@ chunk {3} runtime~main.[chunkhash].js (runtime~main) 0 bytes ={0}= >{1}< >{2} ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.[chunkhash].js 77 bytes 0 [emitted] 1.[chunkhash].js 78 bytes 1 [emitted] -runtime~main.[chunkhash].js 1.76 KiB 2 [emitted] runtime~main +runtime~main.[chunkhash].js 1.79 KiB 2 [emitted] runtime~main main.[chunkhash].js 349 bytes 3 [emitted] main Entrypoint main = runtime~main.[chunkhash].js main.[chunkhash].js chunk {0} 0.[chunkhash].js 29 bytes <{2}> <{3}> [rendered] > ./async2 [0] ./example.js 3:0-18 - [1] ./async2.js 29 bytes {0} [built] - import() ./async2 [0] ./example.js 3:0-18 + [1] ./async2.js 29 bytes {0} [built] + import() ./async2 [0] ./example.js 3:0-18 chunk {1} 1.[chunkhash].js 29 bytes <{2}> <{3}> [rendered] > ./async1 [0] ./example.js 2:0-18 - [2] ./async1.js 29 bytes {1} [built] - import() ./async1 [0] ./example.js 2:0-18 + [2] ./async1.js 29 bytes {1} [built] + import() ./async1 [0] ./example.js 2:0-18 chunk {2} runtime~main.[chunkhash].js (runtime~main) 0 bytes ={3}= >{0}< >{1}< [entry] [rendered] > ./example main chunk {3} main.[chunkhash].js (main) 55 bytes ={2}= >{0}< >{1}< [initial] [rendered] > ./example main - [0] ./example.js 55 bytes {3} [built] - single entry ./example main + [0] ./example.js 55 bytes {3} [built] + single entry ./example main ``` diff --git a/examples/code-splitted-require.context-amd/README.md b/examples/code-splitted-require.context-amd/README.md index 062bba8bb0f..580e02fa0b3 100644 --- a/examples/code-splitted-require.context-amd/README.md +++ b/examples/code-splitted-require.context-amd/README.md @@ -52,12 +52,19 @@ getTemplate("b", function(b) { /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 1: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -113,7 +120,7 @@ getTemplate("b", function(b) { /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -311,54 +318,54 @@ module.exports = function() { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 1.86 KiB 0 [emitted] - output.js 7.19 KiB 1 [emitted] main + output.js 7.46 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 463 bytes <{1}> [rendered] > [0] ./example.js 2:1-4:3 - [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] - amd require context ../require.context/templates [0] ./example.js 2:1-4:3 - [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] - context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js - context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c - [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] - context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js - context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b - [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] - context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js - context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a + [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] + amd require context ../require.context/templates [0] ./example.js 2:1-4:3 + [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] + context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js + context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c + [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] + context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js + context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b + [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] + context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js + context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a chunk {1} output.js (main) 261 bytes >{0}< [entry] [rendered] > .\example.js main - [0] ./example.js 261 bytes {1} [built] - single entry .\example.js main + [0] ./example.js 261 bytes {1} [built] + single entry .\example.js main ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 627 bytes 0 [emitted] - output.js 1.75 KiB 1 [emitted] main + output.js 1.78 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 463 bytes <{1}> [rendered] > [0] ./example.js 2:1-4:3 - [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] - amd require context ../require.context/templates [0] ./example.js 2:1-4:3 - [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] - context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js - context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c - [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] - context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js - context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b - [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] - context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js - context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a + [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] + amd require context ../require.context/templates [0] ./example.js 2:1-4:3 + [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] + context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js + context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c + [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] + context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js + context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b + [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] + context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js + context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a chunk {1} output.js (main) 261 bytes >{0}< [entry] [rendered] > .\example.js main - [0] ./example.js 261 bytes {1} [built] - single entry .\example.js main + [0] ./example.js 261 bytes {1} [built] + single entry .\example.js main ``` diff --git a/examples/code-splitted-require.context/README.md b/examples/code-splitted-require.context/README.md index 08db4e513a1..ada390aca2e 100644 --- a/examples/code-splitted-require.context/README.md +++ b/examples/code-splitted-require.context/README.md @@ -52,12 +52,19 @@ getTemplate("b", function(b) { /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 1: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -113,7 +120,7 @@ getTemplate("b", function(b) { /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -311,54 +318,54 @@ module.exports = function() { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 1.86 KiB 0 [emitted] - output.js 7.13 KiB 1 [emitted] main + output.js 7.4 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 463 bytes <{1}> [rendered] > [0] ./example.js 2:1-4:3 - [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] - cjs require context ../require.context/templates [0] ./example.js 3:11-64 - [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] - context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js - context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c - [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] - context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js - context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b - [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] - context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js - context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a + [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] + cjs require context ../require.context/templates [0] ./example.js 3:11-64 + [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] + context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js + context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c + [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] + context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js + context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b + [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] + context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js + context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a chunk {1} output.js (main) 276 bytes >{0}< [entry] [rendered] > .\example.js main - [0] ./example.js 276 bytes {1} [built] - single entry .\example.js main + [0] ./example.js 276 bytes {1} [built] + single entry .\example.js main ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 627 bytes 0 [emitted] - output.js 1.73 KiB 1 [emitted] main + output.js 1.75 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 463 bytes <{1}> [rendered] > [0] ./example.js 2:1-4:3 - [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] - cjs require context ../require.context/templates [0] ./example.js 3:11-64 - [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] - context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js - context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c - [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] - context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js - context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b - [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] - context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js - context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a + [1] ../require.context/templates sync ^\.\/.*$ 217 bytes {0} [built] + cjs require context ../require.context/templates [0] ./example.js 3:11-64 + [2] ../require.context/templates/c.js 82 bytes {0} [optional] [built] + context element ./c.js [1] ../require.context/templates sync ^\.\/.*$ ./c.js + context element ./c [1] ../require.context/templates sync ^\.\/.*$ ./c + [3] ../require.context/templates/b.js 82 bytes {0} [optional] [built] + context element ./b.js [1] ../require.context/templates sync ^\.\/.*$ ./b.js + context element ./b [1] ../require.context/templates sync ^\.\/.*$ ./b + [4] ../require.context/templates/a.js 82 bytes {0} [optional] [built] + context element ./a.js [1] ../require.context/templates sync ^\.\/.*$ ./a.js + context element ./a [1] ../require.context/templates sync ^\.\/.*$ ./a chunk {1} output.js (main) 276 bytes >{0}< [entry] [rendered] > .\example.js main - [0] ./example.js 276 bytes {1} [built] - single entry .\example.js main + [0] ./example.js 276 bytes {1} [built] + single entry .\example.js main ``` diff --git a/examples/code-splitting-bundle-loader/README.md b/examples/code-splitting-bundle-loader/README.md index 320f01a277a..a59a581ea7c 100644 --- a/examples/code-splitting-bundle-loader/README.md +++ b/examples/code-splitting-bundle-loader/README.md @@ -55,12 +55,19 @@ module.exports = "It works"; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 1: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -116,7 +123,7 @@ module.exports = "It works"; /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -266,40 +273,40 @@ module.exports = "It works"; ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 257 bytes 0 [emitted] - output.js 7.56 KiB 1 [emitted] main + output.js 7.82 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 28 bytes <{1}> [rendered] > [0] (webpack)/node_modules/bundle-loader!./file.js 7:0-14:2 - [2] ./file.js 28 bytes {0} [built] - cjs require !!./file.js [0] (webpack)/node_modules/bundle-loader!./file.js 8:8-30 + [2] ./file.js 28 bytes {0} [built] + cjs require !!./file.js [0] (webpack)/node_modules/bundle-loader!./file.js 8:8-30 chunk {1} output.js (main) 378 bytes >{0}< [entry] [rendered] > .\example.js main - [0] (webpack)/node_modules/bundle-loader!./file.js 281 bytes {1} [built] - cjs require bundle-loader!./file.js [1] ./example.js 1:0-34 - [1] ./example.js 97 bytes {1} [built] - single entry .\example.js main + [0] (webpack)/node_modules/bundle-loader!./file.js 281 bytes {1} [built] + cjs require bundle-loader!./file.js [1] ./example.js 1:0-34 + [1] ./example.js 97 bytes {1} [built] + single entry .\example.js main ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 98 bytes 0 [emitted] - output.js 1.79 KiB 1 [emitted] main + output.js 1.81 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 28 bytes <{1}> [rendered] > [0] (webpack)/node_modules/bundle-loader!./file.js 7:0-14:2 - [2] ./file.js 28 bytes {0} [built] - cjs require !!./file.js [0] (webpack)/node_modules/bundle-loader!./file.js 8:8-30 + [2] ./file.js 28 bytes {0} [built] + cjs require !!./file.js [0] (webpack)/node_modules/bundle-loader!./file.js 8:8-30 chunk {1} output.js (main) 378 bytes >{0}< [entry] [rendered] > .\example.js main - [0] (webpack)/node_modules/bundle-loader!./file.js 281 bytes {1} [built] - cjs require bundle-loader!./file.js [1] ./example.js 1:0-34 - [1] ./example.js 97 bytes {1} [built] - single entry .\example.js main + [0] (webpack)/node_modules/bundle-loader!./file.js 281 bytes {1} [built] + cjs require bundle-loader!./file.js [1] ./example.js 1:0-34 + [1] ./example.js 97 bytes {1} [built] + single entry .\example.js main ``` diff --git a/examples/code-splitting-harmony/README.md b/examples/code-splitting-harmony/README.md index 2757222831f..4db7024d8ce 100644 --- a/examples/code-splitting-harmony/README.md +++ b/examples/code-splitting-harmony/README.md @@ -63,12 +63,19 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) { /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 3: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -124,7 +131,7 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) { /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -305,12 +312,12 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 275 bytes 0 [emitted] 1.output.js 284 bytes 1 [emitted] 2.output.js 270 bytes 2 [emitted] - output.js 8.84 KiB 3 [emitted] main + output.js 9.11 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 13 bytes <{3}> [rendered] > ./2 [2] ./node_modules/c lazy ^\.\/.*$ namespace object ./2 @@ -325,11 +332,11 @@ chunk {2} 2.output.js 11 bytes <{3}> [rendered] 1 module chunk {3} output.js (main) 427 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [2] ./node_modules/c lazy ^\.\/.*$ namespace object 160 bytes {3} [built] - import() context lazy c [4] ./example.js 8:8-27 - [4] ./example.js 256 bytes {3} [built] - [no exports] - single entry .\example.js main + [2] ./node_modules/c lazy ^\.\/.*$ namespace object 160 bytes {3} [built] + import() context lazy c [4] ./example.js 8:8-27 + [4] ./example.js 256 bytes {3} [built] + [no exports] + single entry .\example.js main + 1 hidden module ``` @@ -337,12 +344,12 @@ chunk {3} output.js (main) 427 bytes >{0}< >{1}< >{2}< [entry] [rendered] ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 76 bytes 0 [emitted] 1.output.js 77 bytes 1 [emitted] 2.output.js 78 bytes 2 [emitted] - output.js 2.33 KiB 3 [emitted] main + output.js 2.35 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 13 bytes <{3}> [rendered] > ./2 [2] ./node_modules/c lazy ^\.\/.*$ namespace object ./2 @@ -357,10 +364,10 @@ chunk {2} 2.output.js 11 bytes <{3}> [rendered] 1 module chunk {3} output.js (main) 427 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [2] ./node_modules/c lazy ^\.\/.*$ namespace object 160 bytes {3} [built] - import() context lazy c [4] ./example.js 8:8-27 - [4] ./example.js 256 bytes {3} [built] - [no exports] - single entry .\example.js main + [2] ./node_modules/c lazy ^\.\/.*$ namespace object 160 bytes {3} [built] + import() context lazy c [4] ./example.js 8:8-27 + [4] ./example.js 256 bytes {3} [built] + [no exports] + single entry .\example.js main + 1 hidden module ``` diff --git a/examples/code-splitting-native-import-context-filter/README.md b/examples/code-splitting-native-import-context-filter/README.md index cd137dac06f..50cced4f21a 100644 --- a/examples/code-splitting-native-import-context-filter/README.md +++ b/examples/code-splitting-native-import-context-filter/README.md @@ -81,12 +81,19 @@ export default foo; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 3: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -142,7 +149,7 @@ export default foo; /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -321,78 +328,78 @@ getTemplate("baz.noimport"); ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 433 bytes 0 [emitted] 1.output.js 442 bytes 1 [emitted] 2.output.js 436 bytes 2 [emitted] - output.js 8.21 KiB 3 [emitted] main + output.js 8.47 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 38 bytes <{3}> [rendered] > ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo > ./foo.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js - [0] ./templates/foo.js 38 bytes {0} [optional] [built] - [exports: default] - context element ./foo.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js - context element ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo + [0] ./templates/foo.js 38 bytes {0} [optional] [built] + [exports: default] + context element ./foo.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js + context element ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo chunk {1} 1.output.js 38 bytes <{3}> [rendered] > ./baz [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz > ./baz.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js - [1] ./templates/baz.js 38 bytes {1} [optional] [built] - [exports: default] - context element ./baz.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js - context element ./baz [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz + [1] ./templates/baz.js 38 bytes {1} [optional] [built] + [exports: default] + context element ./baz.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js + context element ./baz [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz chunk {2} 2.output.js 38 bytes <{3}> [rendered] > ./bar [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar > ./bar.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js - [2] ./templates/bar.js 38 bytes {2} [optional] [built] - [exports: default] - context element ./bar.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js - context element ./bar [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar + [2] ./templates/bar.js 38 bytes {2} [optional] [built] + [exports: default] + context element ./bar.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js + context element ./bar [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar chunk {3} output.js (main) 597 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object 160 bytes {3} [optional] [built] - import() context lazy ./templates [4] ./example.js 3:23-7:3 - [4] ./example.js 437 bytes {3} [built] - single entry .\example.js main + [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object 160 bytes {3} [optional] [built] + import() context lazy ./templates [4] ./example.js 3:23-7:3 + [4] ./example.js 437 bytes {3} [built] + single entry .\example.js main ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 113 bytes 0 [emitted] 1.output.js 114 bytes 1 [emitted] 2.output.js 115 bytes 2 [emitted] - output.js 2.13 KiB 3 [emitted] main + output.js 2.16 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 38 bytes <{3}> [rendered] > ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo > ./foo.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js - [0] ./templates/foo.js 38 bytes {0} [optional] [built] - [exports: default] - context element ./foo.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js - context element ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo + [0] ./templates/foo.js 38 bytes {0} [optional] [built] + [exports: default] + context element ./foo.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js + context element ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo chunk {1} 1.output.js 38 bytes <{3}> [rendered] > ./baz [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz > ./baz.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js - [1] ./templates/baz.js 38 bytes {1} [optional] [built] - [exports: default] - context element ./baz.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js - context element ./baz [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz + [1] ./templates/baz.js 38 bytes {1} [optional] [built] + [exports: default] + context element ./baz.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js + context element ./baz [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz chunk {2} 2.output.js 38 bytes <{3}> [rendered] > ./bar [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar > ./bar.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js - [2] ./templates/bar.js 38 bytes {2} [optional] [built] - [exports: default] - context element ./bar.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js - context element ./bar [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar + [2] ./templates/bar.js 38 bytes {2} [optional] [built] + [exports: default] + context element ./bar.js [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js + context element ./bar [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar chunk {3} output.js (main) 597 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object 160 bytes {3} [optional] [built] - import() context lazy ./templates [4] ./example.js 3:23-7:3 - [4] ./example.js 437 bytes {3} [built] - single entry .\example.js main + [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object 160 bytes {3} [optional] [built] + import() context lazy ./templates [4] ./example.js 3:23-7:3 + [4] ./example.js 437 bytes {3} [built] + single entry .\example.js main ``` diff --git a/examples/code-splitting-native-import-context/README.md b/examples/code-splitting-native-import-context/README.md index 0bd87053271..f7405567ed3 100644 --- a/examples/code-splitting-native-import-context/README.md +++ b/examples/code-splitting-native-import-context/README.md @@ -70,12 +70,19 @@ export default foo; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 3: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -131,7 +138,7 @@ export default foo; /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -308,78 +315,78 @@ getTemplate("baz"); ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 436 bytes 0 [emitted] 1.output.js 445 bytes 1 [emitted] 2.output.js 439 bytes 2 [emitted] - output.js 8.03 KiB 3 [emitted] main + output.js 8.3 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 41 bytes <{3}> [rendered] > ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo > ./foo.js [3] ./templates lazy ^\.\/.*$ namespace object ./foo.js - [0] ./templates/foo.js 41 bytes {0} [optional] [built] - [exports: default] - context element ./foo.js [3] ./templates lazy ^\.\/.*$ namespace object ./foo.js - context element ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo + [0] ./templates/foo.js 41 bytes {0} [optional] [built] + [exports: default] + context element ./foo.js [3] ./templates lazy ^\.\/.*$ namespace object ./foo.js + context element ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo chunk {1} 1.output.js 41 bytes <{3}> [rendered] > ./baz [3] ./templates lazy ^\.\/.*$ namespace object ./baz > ./baz.js [3] ./templates lazy ^\.\/.*$ namespace object ./baz.js - [1] ./templates/baz.js 41 bytes {1} [optional] [built] - [exports: default] - context element ./baz.js [3] ./templates lazy ^\.\/.*$ namespace object ./baz.js - context element ./baz [3] ./templates lazy ^\.\/.*$ namespace object ./baz + [1] ./templates/baz.js 41 bytes {1} [optional] [built] + [exports: default] + context element ./baz.js [3] ./templates lazy ^\.\/.*$ namespace object ./baz.js + context element ./baz [3] ./templates lazy ^\.\/.*$ namespace object ./baz chunk {2} 2.output.js 41 bytes <{3}> [rendered] > ./bar [3] ./templates lazy ^\.\/.*$ namespace object ./bar > ./bar.js [3] ./templates lazy ^\.\/.*$ namespace object ./bar.js - [2] ./templates/bar.js 41 bytes {2} [optional] [built] - [exports: default] - context element ./bar.js [3] ./templates lazy ^\.\/.*$ namespace object ./bar.js - context element ./bar [3] ./templates lazy ^\.\/.*$ namespace object ./bar + [2] ./templates/bar.js 41 bytes {2} [optional] [built] + [exports: default] + context element ./bar.js [3] ./templates lazy ^\.\/.*$ namespace object ./bar.js + context element ./bar [3] ./templates lazy ^\.\/.*$ namespace object ./bar chunk {3} output.js (main) 456 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [3] ./templates lazy ^\.\/.*$ namespace object 160 bytes {3} [optional] [built] - import() context lazy ./templates [4] ./example.js 3:23-60 - [4] ./example.js 296 bytes {3} [built] - single entry .\example.js main + [3] ./templates lazy ^\.\/.*$ namespace object 160 bytes {3} [optional] [built] + import() context lazy ./templates [4] ./example.js 3:23-60 + [4] ./example.js 296 bytes {3} [built] + single entry .\example.js main ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 113 bytes 0 [emitted] 1.output.js 114 bytes 1 [emitted] 2.output.js 115 bytes 2 [emitted] - output.js 2.09 KiB 3 [emitted] main + output.js 2.12 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 41 bytes <{3}> [rendered] > ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo > ./foo.js [3] ./templates lazy ^\.\/.*$ namespace object ./foo.js - [0] ./templates/foo.js 41 bytes {0} [optional] [built] - [exports: default] - context element ./foo.js [3] ./templates lazy ^\.\/.*$ namespace object ./foo.js - context element ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo + [0] ./templates/foo.js 41 bytes {0} [optional] [built] + [exports: default] + context element ./foo.js [3] ./templates lazy ^\.\/.*$ namespace object ./foo.js + context element ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo chunk {1} 1.output.js 41 bytes <{3}> [rendered] > ./baz [3] ./templates lazy ^\.\/.*$ namespace object ./baz > ./baz.js [3] ./templates lazy ^\.\/.*$ namespace object ./baz.js - [1] ./templates/baz.js 41 bytes {1} [optional] [built] - [exports: default] - context element ./baz.js [3] ./templates lazy ^\.\/.*$ namespace object ./baz.js - context element ./baz [3] ./templates lazy ^\.\/.*$ namespace object ./baz + [1] ./templates/baz.js 41 bytes {1} [optional] [built] + [exports: default] + context element ./baz.js [3] ./templates lazy ^\.\/.*$ namespace object ./baz.js + context element ./baz [3] ./templates lazy ^\.\/.*$ namespace object ./baz chunk {2} 2.output.js 41 bytes <{3}> [rendered] > ./bar [3] ./templates lazy ^\.\/.*$ namespace object ./bar > ./bar.js [3] ./templates lazy ^\.\/.*$ namespace object ./bar.js - [2] ./templates/bar.js 41 bytes {2} [optional] [built] - [exports: default] - context element ./bar.js [3] ./templates lazy ^\.\/.*$ namespace object ./bar.js - context element ./bar [3] ./templates lazy ^\.\/.*$ namespace object ./bar + [2] ./templates/bar.js 41 bytes {2} [optional] [built] + [exports: default] + context element ./bar.js [3] ./templates lazy ^\.\/.*$ namespace object ./bar.js + context element ./bar [3] ./templates lazy ^\.\/.*$ namespace object ./bar chunk {3} output.js (main) 456 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [3] ./templates lazy ^\.\/.*$ namespace object 160 bytes {3} [optional] [built] - import() context lazy ./templates [4] ./example.js 3:23-60 - [4] ./example.js 296 bytes {3} [built] - single entry .\example.js main + [3] ./templates lazy ^\.\/.*$ namespace object 160 bytes {3} [optional] [built] + import() context lazy ./templates [4] ./example.js 3:23-60 + [4] ./example.js 296 bytes {3} [built] + single entry .\example.js main ``` diff --git a/examples/code-splitting-specify-chunk-name/README.md b/examples/code-splitting-specify-chunk-name/README.md index c97dced3558..fc9d18ecb84 100644 --- a/examples/code-splitting-specify-chunk-name/README.md +++ b/examples/code-splitting-specify-chunk-name/README.md @@ -70,12 +70,19 @@ export default foo; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 3: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -131,7 +138,7 @@ export default foo; /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -300,78 +307,78 @@ __webpack_require__(3)("./ba" + createContextVar).then(function(bar) { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 445 bytes 0 [emitted] chunk-bar-baz2 1.output.js 439 bytes 1 [emitted] chunk-bar-baz0 2.output.js 436 bytes 2 [emitted] chunk-foo - output.js 8.23 KiB 3 [emitted] main + output.js 8.5 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js (chunk-bar-baz2) 41 bytes <{3}> [rendered] > ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz > ./baz.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz.js - [1] ./templates/baz.js 41 bytes {0} [optional] [built] - [exports: default] - context element ./baz.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz.js - context element ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz + [1] ./templates/baz.js 41 bytes {0} [optional] [built] + [exports: default] + context element ./baz.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz.js + context element ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz chunk {1} 1.output.js (chunk-bar-baz0) 41 bytes <{3}> [rendered] > ./bar [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar > ./bar.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar.js - [2] ./templates/bar.js 41 bytes {1} [optional] [built] - [exports: default] - context element ./bar.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar.js - context element ./bar [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar + [2] ./templates/bar.js 41 bytes {1} [optional] [built] + [exports: default] + context element ./bar.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar.js + context element ./bar [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar chunk {2} 2.output.js (chunk-foo) 41 bytes <{3}> [rendered] > ./templates/foo [4] ./example.js 1:0-62 > [4] ./example.js 5:0-8:16 - [0] ./templates/foo.js 41 bytes {2} [built] - [exports: default] - import() ./templates/foo [4] ./example.js 1:0-62 - cjs require ./templates/foo [4] ./example.js 6:11-37 + [0] ./templates/foo.js 41 bytes {2} [built] + [exports: default] + import() ./templates/foo [4] ./example.js 1:0-62 + cjs require ./templates/foo [4] ./example.js 6:11-37 chunk {3} output.js (main) 580 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [3] ./templates lazy ^\.\/ba.*$ namespace object 160 bytes {3} [built] - import() context lazy ./templates [4] ./example.js 11:0-84 - [4] ./example.js 420 bytes {3} [built] - single entry .\example.js main + [3] ./templates lazy ^\.\/ba.*$ namespace object 160 bytes {3} [built] + import() context lazy ./templates [4] ./example.js 11:0-84 + [4] ./example.js 420 bytes {3} [built] + single entry .\example.js main ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 114 bytes 0 [emitted] chunk-bar-baz2 1.output.js 115 bytes 1 [emitted] chunk-bar-baz0 2.output.js 113 bytes 2 [emitted] chunk-foo - output.js 2.12 KiB 3 [emitted] main + output.js 2.14 KiB 3 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js (chunk-bar-baz2) 41 bytes <{3}> [rendered] > ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz > ./baz.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz.js - [1] ./templates/baz.js 41 bytes {0} [optional] [built] - [exports: default] - context element ./baz.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz.js - context element ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz + [1] ./templates/baz.js 41 bytes {0} [optional] [built] + [exports: default] + context element ./baz.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz.js + context element ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz chunk {1} 1.output.js (chunk-bar-baz0) 41 bytes <{3}> [rendered] > ./bar [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar > ./bar.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar.js - [2] ./templates/bar.js 41 bytes {1} [optional] [built] - [exports: default] - context element ./bar.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar.js - context element ./bar [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar + [2] ./templates/bar.js 41 bytes {1} [optional] [built] + [exports: default] + context element ./bar.js [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar.js + context element ./bar [3] ./templates lazy ^\.\/ba.*$ namespace object ./bar chunk {2} 2.output.js (chunk-foo) 41 bytes <{3}> [rendered] > ./templates/foo [4] ./example.js 1:0-62 > [4] ./example.js 5:0-8:16 - [0] ./templates/foo.js 41 bytes {2} [built] - [exports: default] - import() ./templates/foo [4] ./example.js 1:0-62 - cjs require ./templates/foo [4] ./example.js 6:11-37 + [0] ./templates/foo.js 41 bytes {2} [built] + [exports: default] + import() ./templates/foo [4] ./example.js 1:0-62 + cjs require ./templates/foo [4] ./example.js 6:11-37 chunk {3} output.js (main) 580 bytes >{0}< >{1}< >{2}< [entry] [rendered] > .\example.js main - [3] ./templates lazy ^\.\/ba.*$ namespace object 160 bytes {3} [built] - import() context lazy ./templates [4] ./example.js 11:0-84 - [4] ./example.js 420 bytes {3} [built] - single entry .\example.js main + [3] ./templates lazy ^\.\/ba.*$ namespace object 160 bytes {3} [built] + import() context lazy ./templates [4] ./example.js 11:0-84 + [4] ./example.js 420 bytes {3} [built] + single entry .\example.js main ``` diff --git a/examples/code-splitting/README.md b/examples/code-splitting/README.md index 409dc05ba58..c6dd1964083 100644 --- a/examples/code-splitting/README.md +++ b/examples/code-splitting/README.md @@ -74,12 +74,19 @@ require.ensure(["c"], function(require) { /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 1: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -135,7 +142,7 @@ require.ensure(["c"], function(require) { /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -301,18 +308,18 @@ Minimized ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 490 bytes 0 [emitted] - output.js 7.47 KiB 1 [emitted] main + output.js 7.73 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 22 bytes <{1}> [rendered] > [2] ./example.js 3:0-6:2 2 modules chunk {1} output.js (main) 166 bytes >{0}< [entry] [rendered] > .\example.js main - [2] ./example.js 144 bytes {1} [built] - single entry .\example.js main + [2] ./example.js 144 bytes {1} [built] + single entry .\example.js main + 2 hidden modules ``` @@ -320,17 +327,17 @@ chunk {1} output.js (main) 166 bytes >{0}< [entry] [rendered] ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 95 bytes 0 [emitted] - output.js 1.68 KiB 1 [emitted] main + output.js 1.71 KiB 1 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 22 bytes <{1}> [rendered] > [2] ./example.js 3:0-6:2 2 modules chunk {1} output.js (main) 166 bytes >{0}< [entry] [rendered] > .\example.js main - [2] ./example.js 144 bytes {1} [built] - single entry .\example.js main + [2] ./example.js 144 bytes {1} [built] + single entry .\example.js main + 2 hidden modules ``` diff --git a/examples/coffee-script/README.md b/examples/coffee-script/README.md index f857255c0d4..3f9c31fa5af 100644 --- a/examples/coffee-script/README.md +++ b/examples/coffee-script/README.md @@ -153,36 +153,36 @@ module.exports = 42; ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names output.js 3.35 KiB 0 [emitted] main Entrypoint main = output.js chunk {0} output.js (main) 206 bytes [entry] [rendered] > .\example.js main - [0] ./example.js 31 bytes {0} [built] - single entry .\example.js main - [1] ./cup1.coffee 118 bytes {0} [built] - cjs require ./cup1 [0] ./example.js 1:12-29 - [2] ./cup2.coffee 57 bytes {0} [built] - cjs require ./cup2.coffee [1] ./cup1.coffee 4:12-36 - cjs require ./cup2 [1] ./cup1.coffee 5:9-26 + [0] ./example.js 31 bytes {0} [built] + single entry .\example.js main + [1] ./cup1.coffee 118 bytes {0} [built] + cjs require ./cup1 [0] ./example.js 1:12-29 + [2] ./cup2.coffee 57 bytes {0} [built] + cjs require ./cup2.coffee [1] ./cup1.coffee 4:12-36 + cjs require ./cup2 [1] ./cup1.coffee 5:9-26 ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names output.js 708 bytes 0 [emitted] main Entrypoint main = output.js chunk {0} output.js (main) 206 bytes [entry] [rendered] > .\example.js main - [0] ./cup2.coffee 57 bytes {0} [built] - cjs require ./cup2.coffee [1] ./cup1.coffee 4:12-36 - cjs require ./cup2 [1] ./cup1.coffee 5:9-26 - [1] ./cup1.coffee 118 bytes {0} [built] - cjs require ./cup1 [2] ./example.js 1:12-29 - [2] ./example.js 31 bytes {0} [built] - single entry .\example.js main + [0] ./cup2.coffee 57 bytes {0} [built] + cjs require ./cup2.coffee [1] ./cup1.coffee 4:12-36 + cjs require ./cup2 [1] ./cup1.coffee 5:9-26 + [1] ./cup1.coffee 118 bytes {0} [built] + cjs require ./cup1 [2] ./example.js 1:12-29 + [2] ./example.js 31 bytes {0} [built] + single entry .\example.js main ``` \ No newline at end of file diff --git a/examples/common-chunk-and-vendor-chunk/README.md b/examples/common-chunk-and-vendor-chunk/README.md index 89d27e640cc..f6d5e46aa9c 100644 --- a/examples/common-chunk-and-vendor-chunk/README.md +++ b/examples/common-chunk-and-vendor-chunk/README.md @@ -195,6 +195,8 @@ module.exports = "utility3"; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 0: 0 /******/ }; @@ -368,6 +370,8 @@ module.exports = "utility1"; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 1: 0 /******/ }; @@ -527,6 +531,8 @@ module.exports = "pageB"; /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 2: 0 /******/ }; @@ -634,11 +640,11 @@ module.exports = "pageC"; ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names - pageA.js 5.59 KiB 0 [emitted] pageA - pageB.js 5.39 KiB 1 [emitted] pageB - pageC.js 5.34 KiB 2 [emitted] pageC + pageA.js 5.72 KiB 0 [emitted] pageA + pageB.js 5.52 KiB 1 [emitted] pageB + pageC.js 5.47 KiB 2 [emitted] pageC vendor.js 536 bytes 3 [emitted] vendor commons~pageA~pageB~pageC.js 269 bytes 4 [emitted] commons~pageA~pageB~pageC commons~pageB~pageC.js 269 bytes 5 [emitted] commons~pageB~pageC @@ -647,18 +653,18 @@ Entrypoint pageB = vendor.js commons~pageA~pageB~pageC.js commons~pageB~pageC.js Entrypoint pageC = commons~pageA~pageB~pageC.js commons~pageB~pageC.js pageC.js chunk {0} pageA.js (pageA) 165 bytes ={3}= ={4}= [entry] [rendered] > ./pageA pageA - [0] ./pageA.js 137 bytes {0} [built] - single entry ./pageA pageA - [2] ./utility1.js 28 bytes {0} [built] - cjs require ./utility1 [0] ./pageA.js 2:15-36 + [0] ./pageA.js 137 bytes {0} [built] + single entry ./pageA pageA + [2] ./utility1.js 28 bytes {0} [built] + cjs require ./utility1 [0] ./pageA.js 2:15-36 chunk {1} pageB.js (pageB) 137 bytes ={3}= ={4}= ={5}= [entry] [rendered] > ./pageB pageB - [4] ./pageB.js 137 bytes {1} [built] - single entry ./pageB pageB + [4] ./pageB.js 137 bytes {1} [built] + single entry ./pageB pageB chunk {2} pageC.js (pageC) 105 bytes ={4}= ={5}= [entry] [rendered] > ./pageC pageC - [7] ./pageC.js 105 bytes {2} [built] - single entry ./pageC pageC + [7] ./pageC.js 105 bytes {2} [built] + single entry ./pageC pageC chunk {3} vendor.js (vendor) 54 bytes ={0}= ={1}= ={4}= ={5}= [initial] [rendered] split chunk (cache group: vendor) (name: vendor) > ./pageA pageA > ./pageB pageB @@ -667,23 +673,23 @@ chunk {4} commons~pageA~pageB~pageC.js (commons~pageA~pageB~pageC) 28 bytes = > ./pageA pageA > ./pageB pageB > ./pageC pageC - [3] ./utility2.js 28 bytes {4} [built] - cjs require ./utility2 [0] ./pageA.js 3:15-36 - cjs require ./utility2 [4] ./pageB.js 2:15-36 - cjs require ./utility2 [7] ./pageC.js 1:15-36 + [3] ./utility2.js 28 bytes {4} [built] + cjs require ./utility2 [0] ./pageA.js 3:15-36 + cjs require ./utility2 [4] ./pageB.js 2:15-36 + cjs require ./utility2 [7] ./pageC.js 1:15-36 chunk {5} commons~pageB~pageC.js (commons~pageB~pageC) 28 bytes ={1}= ={2}= ={3}= ={4}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageB~pageC) > ./pageB pageB > ./pageC pageC - [6] ./utility3.js 28 bytes {5} [built] - cjs require ./utility3 [4] ./pageB.js 3:15-36 - cjs require ./utility3 [7] ./pageC.js 2:15-36 + [6] ./utility3.js 28 bytes {5} [built] + cjs require ./utility3 [4] ./pageB.js 3:15-36 + cjs require ./utility3 [7] ./pageC.js 2:15-36 ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names commons~pageA~pageB~pageC.js 96 bytes 0 [emitted] commons~pageA~pageB~pageC commons~pageB~pageC.js 97 bytes 1 [emitted] commons~pageB~pageC @@ -698,32 +704,32 @@ chunk {0} commons~pageA~pageB~pageC.js (commons~pageA~pageB~pageC) 28 bytes = > ./pageA pageA > ./pageB pageB > ./pageC pageC - [0] ./utility2.js 28 bytes {0} [built] - cjs require ./utility2 [2] ./pageC.js 1:15-36 - cjs require ./utility2 [4] ./pageB.js 2:15-36 - cjs require ./utility2 [7] ./pageA.js 3:15-36 + [0] ./utility2.js 28 bytes {0} [built] + cjs require ./utility2 [2] ./pageC.js 1:15-36 + cjs require ./utility2 [4] ./pageB.js 2:15-36 + cjs require ./utility2 [7] ./pageA.js 3:15-36 chunk {1} commons~pageB~pageC.js (commons~pageB~pageC) 28 bytes ={0}= ={2}= ={3}= ={4}= [initial] [rendered] split chunk (cache group: commons) (name: commons~pageB~pageC) > ./pageB pageB > ./pageC pageC - [1] ./utility3.js 28 bytes {1} [built] - cjs require ./utility3 [2] ./pageC.js 2:15-36 - cjs require ./utility3 [4] ./pageB.js 3:15-36 + [1] ./utility3.js 28 bytes {1} [built] + cjs require ./utility3 [2] ./pageC.js 2:15-36 + cjs require ./utility3 [4] ./pageB.js 3:15-36 chunk {2} vendor.js (vendor) 54 bytes ={0}= ={1}= ={4}= ={5}= [initial] [rendered] split chunk (cache group: vendor) (name: vendor) > ./pageA pageA > ./pageB pageB 2 modules chunk {3} pageC.js (pageC) 105 bytes ={0}= ={1}= [entry] [rendered] > ./pageC pageC - [2] ./pageC.js 105 bytes {3} [built] - single entry ./pageC pageC + [2] ./pageC.js 105 bytes {3} [built] + single entry ./pageC pageC chunk {4} pageB.js (pageB) 137 bytes ={0}= ={1}= ={2}= [entry] [rendered] > ./pageB pageB - [4] ./pageB.js 137 bytes {4} [built] - single entry ./pageB pageB + [4] ./pageB.js 137 bytes {4} [built] + single entry ./pageB pageB chunk {5} pageA.js (pageA) 165 bytes ={0}= ={2}= [entry] [rendered] > ./pageA pageA - [5] ./utility1.js 28 bytes {5} [built] - cjs require ./utility1 [7] ./pageA.js 2:15-36 - [7] ./pageA.js 137 bytes {5} [built] - single entry ./pageA pageA + [5] ./utility1.js 28 bytes {5} [built] + cjs require ./utility1 [7] ./pageA.js 2:15-36 + [7] ./pageA.js 137 bytes {5} [built] + single entry ./pageA pageA ``` diff --git a/examples/common-chunk-grandchildren/README.md b/examples/common-chunk-grandchildren/README.md index 3a833d7a1aa..9ce9e748da9 100644 --- a/examples/common-chunk-grandchildren/README.md +++ b/examples/common-chunk-grandchildren/README.md @@ -142,12 +142,19 @@ module.exports = { /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 4: 0 /******/ }; /******/ /******/ /******/ +/******/ // script path function +/******/ function jsonpScriptSrc(chunkId) { +/******/ return __webpack_require__.p + "" + chunkId + ".output.js" +/******/ } +/******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ @@ -203,7 +210,7 @@ module.exports = { /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "" + chunkId + ".output.js"; +/******/ script.src = jsonpScriptSrc(chunkId); /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); @@ -430,74 +437,74 @@ module.exports = function() { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 340 bytes 0 [emitted] 1.output.js 549 bytes 1 [emitted] 2.output.js 414 bytes 2 [emitted] 3.output.js 414 bytes 3 [emitted] - output.js 7.53 KiB 4 [emitted] main + output.js 7.79 KiB 4 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 72 bytes <{1}> <{4}> ={2}= ={3}= [rendered] split chunk (cache group: default) > [0] ./example.js 3:1-6:3 > [2] ./pageB.js 3:1-6:3 - [4] ./reusableComponent.js 72 bytes {0} [built] - cjs require ./reusableComponent [3] ./pageA.js 1:24-54 - cjs require ./reusableComponent [5] ./pageC.js 1:24-54 + [4] ./reusableComponent.js 72 bytes {0} [built] + cjs require ./reusableComponent [3] ./pageA.js 1:24-54 + cjs require ./reusableComponent [5] ./pageC.js 1:24-54 chunk {1} 1.output.js 140 bytes <{4}> >{0}< >{3}< [rendered] > [0] ./example.js 7:1-10:3 - [2] ./pageB.js 140 bytes {1} [built] - cjs require ./pageB [0] ./example.js 8:15-33 + [2] ./pageB.js 140 bytes {1} [built] + cjs require ./pageB [0] ./example.js 8:15-33 chunk {2} 2.output.js 142 bytes <{4}> ={0}= [rendered] > [0] ./example.js 3:1-6:3 - [3] ./pageA.js 142 bytes {2} [built] - cjs require ./pageA [0] ./example.js 4:15-33 + [3] ./pageA.js 142 bytes {2} [built] + cjs require ./pageA [0] ./example.js 4:15-33 chunk {3} 3.output.js 142 bytes <{1}> ={0}= [rendered] > [2] ./pageB.js 3:1-6:3 - [5] ./pageC.js 142 bytes {3} [built] - cjs require ./pageC [2] ./pageB.js 4:15-33 + [5] ./pageC.js 142 bytes {3} [built] + cjs require ./pageC [2] ./pageB.js 4:15-33 chunk {4} output.js (main) 261 bytes >{0}< >{1}< >{2}< [entry] [rendered] > main - [0] ./example.js 233 bytes {4} [built] - single entry ./example.js [1] multi ./example.js main:100000 - [1] multi ./example.js 28 bytes {4} [built] - multi entry + [0] ./example.js 233 bytes {4} [built] + single entry ./example.js [1] multi ./example.js main:100000 + [1] multi ./example.js 28 bytes {4} [built] + multi entry ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names 0.output.js 133 bytes 0 [emitted] 1.output.js 198 bytes 1 [emitted] 2.output.js 138 bytes 2 [emitted] 3.output.js 138 bytes 3 [emitted] - output.js 1.76 KiB 4 [emitted] main + output.js 1.78 KiB 4 [emitted] main Entrypoint main = output.js chunk {0} 0.output.js 72 bytes <{1}> <{4}> ={2}= ={3}= [rendered] split chunk (cache group: default) > [0] ./example.js 3:1-6:3 > [2] ./pageB.js 3:1-6:3 - [4] ./reusableComponent.js 72 bytes {0} [built] - cjs require ./reusableComponent [3] ./pageA.js 1:24-54 - cjs require ./reusableComponent [5] ./pageC.js 1:24-54 + [4] ./reusableComponent.js 72 bytes {0} [built] + cjs require ./reusableComponent [3] ./pageA.js 1:24-54 + cjs require ./reusableComponent [5] ./pageC.js 1:24-54 chunk {1} 1.output.js 140 bytes <{4}> >{0}< >{3}< [rendered] > [0] ./example.js 7:1-10:3 - [2] ./pageB.js 140 bytes {1} [built] - cjs require ./pageB [0] ./example.js 8:15-33 + [2] ./pageB.js 140 bytes {1} [built] + cjs require ./pageB [0] ./example.js 8:15-33 chunk {2} 2.output.js 142 bytes <{4}> ={0}= [rendered] > [0] ./example.js 3:1-6:3 - [3] ./pageA.js 142 bytes {2} [built] - cjs require ./pageA [0] ./example.js 4:15-33 + [3] ./pageA.js 142 bytes {2} [built] + cjs require ./pageA [0] ./example.js 4:15-33 chunk {3} 3.output.js 142 bytes <{1}> ={0}= [rendered] > [2] ./pageB.js 3:1-6:3 - [5] ./pageC.js 142 bytes {3} [built] - cjs require ./pageC [2] ./pageB.js 4:15-33 + [5] ./pageC.js 142 bytes {3} [built] + cjs require ./pageC [2] ./pageB.js 4:15-33 chunk {4} output.js (main) 261 bytes >{0}< >{1}< >{2}< [entry] [rendered] > main - [0] ./example.js 233 bytes {4} [built] - single entry ./example.js [1] multi ./example.js main:100000 - [1] multi ./example.js 28 bytes {4} [built] - multi entry + [0] ./example.js 233 bytes {4} [built] + single entry ./example.js [1] multi ./example.js main:100000 + [1] multi ./example.js 28 bytes {4} [built] + multi entry ``` diff --git a/examples/commonjs/README.md b/examples/commonjs/README.md index 92f30d4b76f..fb85a0b1c08 100644 --- a/examples/commonjs/README.md +++ b/examples/commonjs/README.md @@ -167,34 +167,34 @@ exports.add = function() { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names output.js 3.44 KiB 0 [emitted] main Entrypoint main = output.js chunk {0} output.js (main) 329 bytes [entry] [rendered] > .\example.js main - [0] ./example.js 69 bytes {0} [built] - single entry .\example.js main - [1] ./increment.js 98 bytes {0} [built] - cjs require ./increment [0] ./example.js 1:10-32 - [2] ./math.js 162 bytes {0} [built] - cjs require ./math [1] ./increment.js 1:10-27 + [0] ./example.js 69 bytes {0} [built] + single entry .\example.js main + [1] ./increment.js 98 bytes {0} [built] + cjs require ./increment [0] ./example.js 1:10-32 + [2] ./math.js 162 bytes {0} [built] + cjs require ./math [1] ./increment.js 1:10-27 ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names output.js 740 bytes 0 [emitted] main Entrypoint main = output.js chunk {0} output.js (main) 329 bytes [entry] [rendered] > .\example.js main - [0] ./math.js 162 bytes {0} [built] - cjs require ./math [1] ./increment.js 1:10-27 - [1] ./increment.js 98 bytes {0} [built] - cjs require ./increment [2] ./example.js 1:10-32 - [2] ./example.js 69 bytes {0} [built] - single entry .\example.js main + [0] ./math.js 162 bytes {0} [built] + cjs require ./math [1] ./increment.js 1:10-27 + [1] ./increment.js 98 bytes {0} [built] + cjs require ./increment [2] ./example.js 1:10-32 + [2] ./example.js 69 bytes {0} [built] + single entry .\example.js main ``` \ No newline at end of file diff --git a/examples/dll-app-and-vendor/0-vendor/README.md b/examples/dll-app-and-vendor/0-vendor/README.md index 61b4320f62d..f8c57e9d748 100644 --- a/examples/dll-app-and-vendor/0-vendor/README.md +++ b/examples/dll-app-and-vendor/0-vendor/README.md @@ -41,7 +41,7 @@ export function square(n) { # dist/vendor.js ``` javascript -var vendor_lib_bc3751dcff9f91451e0e = +var vendor_lib_f3fbcfb4ec389ba5bbf0 = ```
/******/ (function(modules) { /* webpackBootstrap */ }) @@ -157,7 +157,7 @@ function square(n) { # dist/vendor-manifest.json ``` javascript -{"name":"vendor_lib_bc3751dcff9f91451e0e","content":{"../node_modules/example-vendor.js":{"id":1,"buildMeta":{"exportsType":"namespace","providedExports":["square"]}}}} +{"name":"vendor_lib_f3fbcfb4ec389ba5bbf0","content":{"../node_modules/example-vendor.js":{"id":1,"buildMeta":{"exportsType":"namespace","providedExports":["square"]}}}} ``` # Info @@ -166,15 +166,15 @@ function square(n) { ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names vendor.js 3.32 KiB 0 [emitted] main Entrypoint main = vendor.js chunk {0} vendor.js (main) 60 bytes [entry] [rendered] > main - [0] dll main 12 bytes {0} [built] - dll entry - + [0] dll main 12 bytes {0} [built] + dll entry + + 1 hidden module ``` @@ -182,15 +182,15 @@ chunk {0} vendor.js (main) 60 bytes [entry] [rendered] ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names vendor.js 704 bytes 0 [emitted] main Entrypoint main = vendor.js chunk {0} vendor.js (main) 60 bytes [entry] [rendered] > main - [1] dll main 12 bytes {0} [built] - dll entry - + [1] dll main 12 bytes {0} [built] + dll entry + + 1 hidden module ``` diff --git a/examples/dll-app-and-vendor/1-app/README.md b/examples/dll-app-and-vendor/1-app/README.md index 84f722ff6f7..d8b1e628fe2 100644 --- a/examples/dll-app-and-vendor/1-app/README.md +++ b/examples/dll-app-and-vendor/1-app/README.md @@ -147,22 +147,22 @@ console.log(new example_vendor__WEBPACK_IMPORTED_MODULE_0__["square"](7)); /***/ }), /* 1 */ /*!******************************************************************************************************!*\ - !*** delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e ***! + !*** delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 ***! \******************************************************************************************************/ /*! exports provided: square */ /***/ (function(module, exports, __webpack_require__) { -module.exports = (__webpack_require__(/*! dll-reference vendor_lib_bc3751dcff9f91451e0e */ 2))(1); +module.exports = (__webpack_require__(/*! dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 */ 2))(1); /***/ }), /* 2 */ /*!**************************************************!*\ - !*** external "vendor_lib_bc3751dcff9f91451e0e" ***! + !*** external "vendor_lib_f3fbcfb4ec389ba5bbf0" ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports) { -module.exports = vendor_lib_bc3751dcff9f91451e0e; +module.exports = vendor_lib_f3fbcfb4ec389ba5bbf0; /***/ }) /******/ ]); @@ -174,44 +174,44 @@ module.exports = vendor_lib_bc3751dcff9f91451e0e; ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names app.js 3.9 KiB 0 [emitted] main Entrypoint main = app.js chunk {0} app.js (main) 182 bytes [entry] [rendered] > ./example-app main - [0] ./example-app.js 98 bytes {0} [built] - [no exports] - single entry ./example-app main - [1] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e 42 bytes {0} [built] - [exports: square] - harmony side effect evaluation example-vendor [0] ./example-app.js 1:0-40 - harmony import specifier example-vendor [0] ./example-app.js 3:12-18 - harmony import specifier example-vendor [0] ./example-app.js 4:16-22 - [2] external "vendor_lib_bc3751dcff9f91451e0e" 42 bytes {0} [built] - delegated source dll-reference vendor_lib_bc3751dcff9f91451e0e [1] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e + [0] ./example-app.js 98 bytes {0} [built] + [no exports] + single entry ./example-app main + [1] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 42 bytes {0} [built] + [exports: square] + harmony side effect evaluation example-vendor [0] ./example-app.js 1:0-40 + harmony import specifier example-vendor [0] ./example-app.js 3:12-18 + harmony import specifier example-vendor [0] ./example-app.js 4:16-22 + [2] external "vendor_lib_f3fbcfb4ec389ba5bbf0" 42 bytes {0} [built] + delegated source dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 [1] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 ``` ## Production mode ``` Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 4.5.0 +Version: webpack 4.8.0 Asset Size Chunks Chunk Names app.js 736 bytes 0 [emitted] main Entrypoint main = app.js chunk {0} app.js (main) 182 bytes [entry] [rendered] > ./example-app main - [0] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e 42 bytes {0} [built] - [exports: square] - harmony side effect evaluation example-vendor [2] ./example-app.js 1:0-40 - harmony import specifier example-vendor [2] ./example-app.js 3:12-18 - harmony import specifier example-vendor [2] ./example-app.js 4:16-22 - [1] external "vendor_lib_bc3751dcff9f91451e0e" 42 bytes {0} [built] - delegated source dll-reference vendor_lib_bc3751dcff9f91451e0e [0] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e - [2] ./example-app.js 98 bytes {0} [built] - [no exports] - single entry ./example-app main + [0] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 42 bytes {0} [built] + [exports: square] + harmony side effect evaluation example-vendor [2] ./example-app.js 1:0-40 + harmony import specifier example-vendor [2] ./example-app.js 3:12-18 + harmony import specifier example-vendor [2] ./example-app.js 4:16-22 + [1] external "vendor_lib_f3fbcfb4ec389ba5bbf0" 42 bytes {0} [built] + delegated source dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 [0] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 + [2] ./example-app.js 98 bytes {0} [built] + [no exports] + single entry ./example-app main ```