From bd2038395aae44058313d5ebc26312cbe1acb9cd Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Sun, 20 Sep 2020 22:39:12 +0200 Subject: [PATCH] update examples --- examples/aggressive-merging/README.md | 212 ++--- examples/asset-advanced/README.md | 152 ++-- examples/asset-simple/README.md | 222 +++--- examples/chunkhash/README.md | 221 +++--- examples/cjs-tree-shaking/README.md | 123 +-- .../README.md | 221 +++--- .../code-splitted-require.context/README.md | 221 +++--- .../code-splitting-bundle-loader/README.md | 194 ++--- .../README.md | 443 ++++++----- .../code-splitting-depend-on-simple/README.md | 183 +++-- examples/code-splitting-harmony/README.md | 318 ++++---- .../README.md | 265 ++++--- .../README.md | 265 ++++--- .../README.md | 265 ++++--- examples/code-splitting/README.md | 206 ++--- examples/coffee-script/README.md | 53 +- .../common-chunk-and-vendor-chunk/README.md | 328 ++++---- examples/common-chunk-grandchildren/README.md | 276 ++++--- examples/commonjs/README.md | 59 +- examples/custom-json-modules/README.md | 153 ++-- .../dll-app-and-vendor/0-vendor/README.md | 54 +- examples/dll-app-and-vendor/1-app/README.md | 125 ++- examples/dll-entry-only/README.md | 79 +- examples/dll-user/README.md | 121 +-- examples/dll/README.md | 109 +-- examples/explicit-vendor-chunk/README.md | 199 ++--- examples/externals/README.md | 61 +- examples/extra-async-chunk-advanced/README.md | 368 +++++---- examples/extra-async-chunk/README.md | 268 ++++--- examples/harmony-interop/README.md | 169 ++-- examples/harmony-library/README.md | 51 +- examples/harmony-unused/README.md | 190 +++-- examples/harmony/README.md | 253 +++--- examples/http2-aggressive-splitting/README.md | 83 +- examples/hybrid-routing/README.md | 357 ++++----- examples/hybrid-routing/template.md | 6 +- examples/loader/README.md | 74 +- examples/many-pages/README.md | 180 ++--- examples/mixed/README.md | 268 +++---- examples/module-federation/README.md | 739 +++++++++--------- examples/module/README.md | 39 +- examples/multi-compiler/README.md | 87 +-- examples/multi-part-library/README.md | 76 +- examples/multiple-entry-points/README.md | 396 +++++----- examples/named-chunks/README.md | 274 ++++--- examples/persistent-caching/README.md | 42 +- examples/require.context/README.md | 83 +- examples/require.resolve/README.md | 47 +- examples/scope-hoisting/README.md | 257 +++--- examples/scope-hoisting/template.md | 6 +- examples/side-effects/README.md | 194 +++-- examples/source-map/README.md | 439 +++++------ examples/top-level-await/README.md | 110 ++- examples/two-explicit-vendor-chunks/README.md | 204 +++-- examples/typescript/README.md | 127 ++- examples/wasm-complex/README.md | 100 +-- examples/wasm-simple/README.md | 122 +-- examples/worker/README.md | 28 +- 58 files changed, 5189 insertions(+), 5576 deletions(-) diff --git a/examples/aggressive-merging/README.md b/examples/aggressive-merging/README.md index 145e5a122..087f3342b 100644 --- a/examples/aggressive-merging/README.md +++ b/examples/aggressive-merging/README.md @@ -60,117 +60,117 @@ module.exports = { ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size - 394.chunk.js 638 bytes [emitted] - 456.chunk.js 6.32 KiB [emitted] -pageA.bundle.js 7.91 KiB [emitted] [name: pageA] -pageB.bundle.js 7.91 KiB [emitted] [name: pageB] -pageC.bundle.js 7.91 KiB [emitted] [name: pageC] -Entrypoint pageA = pageA.bundle.js -Entrypoint pageB = pageB.bundle.js -Entrypoint pageC = pageC.bundle.js -chunk pageB.bundle.js (pageB) 69 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./pageB pageB - ./pageB.js 69 bytes [built] - [no exports used] - entry ./pageB pageB - + 5 hidden chunk modules -chunk pageC.bundle.js (pageC) 68 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./pageC pageC - ./pageC.js 68 bytes [built] - [no exports used] - entry ./pageC pageC - + 5 hidden chunk modules +asset pageA.bundle.js 8.76 KiB [emitted] (name: pageA) +asset pageB.bundle.js 8.76 KiB [emitted] (name: pageB) +asset pageC.bundle.js 8.76 KiB [emitted] (name: pageC) +asset 456.chunk.js 6.28 KiB [emitted] +asset 394.chunk.js 606 bytes [emitted] +chunk pageB.bundle.js (pageB) 69 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./pageB pageB + runtime modules 4.85 KiB 6 modules + ./pageB.js 69 bytes [built] [code generated] + [used exports unknown] + entry ./pageB pageB +chunk pageC.bundle.js (pageC) 68 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./pageC pageC + runtime modules 4.85 KiB 6 modules + ./pageC.js 68 bytes [built] [code generated] + [used exports unknown] + entry ./pageC pageC chunk 394.chunk.js 42 bytes [rendered] - > ./a ./pageC.js 1:0-3:2 - ./a.js 21 bytes [built] - cjs self exports reference ./a.js 1:0-14 - cjs require ./a ./pageA.js 2:8-22 - amd require ./a ./pageC.js 1:0-3:2 - ./b.js 21 bytes [built] - cjs self exports reference ./b.js 1:0-14 - cjs require ./b ./pageB.js 2:8-22 - cjs require ./b ./pageC.js 2:17-31 -chunk pageA.bundle.js (pageA) 69 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./pageA pageA - ./pageA.js 69 bytes [built] - [no exports used] - entry ./pageA pageA - + 5 hidden chunk modules + > ./a ./pageC.js 1:0-3:2 + ./a.js 21 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./a.js 1:0-14 + cjs require ./a ./pageA.js 2:8-22 + amd require ./a ./pageC.js 1:0-3:2 + ./b.js 21 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./b.js 1:0-14 + cjs require ./b ./pageB.js 2:8-22 + cjs require ./b ./pageC.js 2:17-31 +chunk pageA.bundle.js (pageA) 69 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./pageA pageA + runtime modules 4.85 KiB 6 modules + ./pageA.js 69 bytes [built] [code generated] + [used exports unknown] + entry ./pageA pageA chunk 456.chunk.js 5.45 KiB [rendered] - > ./common ./pageA.js 1:0-3:2 - > ./common ./pageB.js 1:0-3:2 - ./a.js 21 bytes [built] - cjs self exports reference ./a.js 1:0-14 - cjs require ./a ./pageA.js 2:8-22 - amd require ./a ./pageC.js 1:0-3:2 - ./b.js 21 bytes [built] - cjs self exports reference ./b.js 1:0-14 - cjs require ./b ./pageB.js 2:8-22 - cjs require ./b ./pageC.js 2:17-31 - ./common.js 5.41 KiB [built] - cjs self exports reference ./common.js 1:0-14 - amd require ./common ./pageA.js 1:0-3:2 - amd require ./common ./pageB.js 1:0-3:2 + > ./common ./pageA.js 1:0-3:2 + > ./common ./pageB.js 1:0-3:2 + ./a.js 21 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./a.js 1:0-14 + cjs require ./a ./pageA.js 2:8-22 + amd require ./a ./pageC.js 1:0-3:2 + ./b.js 21 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./b.js 1:0-14 + cjs require ./b ./pageB.js 2:8-22 + cjs require ./b ./pageC.js 2:17-31 + ./common.js 5.41 KiB [built] [code generated] + [used exports unknown] + cjs self exports reference ./common.js 1:0-14 + amd require ./common ./pageA.js 1:0-3:2 + amd require ./common ./pageB.js 1:0-3:2 +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size - 394.chunk.js 108 bytes [emitted] - 456.chunk.js 159 bytes [emitted] -pageA.bundle.js 1.36 KiB [emitted] [name: pageA] -pageB.bundle.js 1.36 KiB [emitted] [name: pageB] -pageC.bundle.js 1.37 KiB [emitted] [name: pageC] -Entrypoint pageA = pageA.bundle.js -Entrypoint pageB = pageB.bundle.js -Entrypoint pageC = pageC.bundle.js -chunk pageB.bundle.js (pageB) 69 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./pageB pageB - ./pageB.js 69 bytes [built] - [no exports used] - entry ./pageB pageB - + 5 hidden chunk modules -chunk pageC.bundle.js (pageC) 68 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./pageC pageC - ./pageC.js 68 bytes [built] - [no exports used] - entry ./pageC pageC - + 5 hidden chunk modules -chunk 394.chunk.js 42 bytes [rendered] - > ./a ./pageC.js 1:0-3:2 - ./a.js 21 bytes [built] - cjs self exports reference ./a.js 1:0-14 - cjs require ./a ./pageA.js 2:8-22 - amd require ./a ./pageC.js 1:0-3:2 - ./b.js 21 bytes [built] - cjs self exports reference ./b.js 1:0-14 - cjs require ./b ./pageB.js 2:8-22 - cjs require ./b ./pageC.js 2:17-31 -chunk pageA.bundle.js (pageA) 69 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./pageA pageA - ./pageA.js 69 bytes [built] - [no exports used] - entry ./pageA pageA - + 5 hidden chunk modules -chunk 456.chunk.js 5.45 KiB [rendered] - > ./common ./pageA.js 1:0-3:2 - > ./common ./pageB.js 1:0-3:2 - ./a.js 21 bytes [built] - cjs self exports reference ./a.js 1:0-14 - cjs require ./a ./pageA.js 2:8-22 - amd require ./a ./pageC.js 1:0-3:2 - ./b.js 21 bytes [built] - cjs self exports reference ./b.js 1:0-14 - cjs require ./b ./pageB.js 2:8-22 - cjs require ./b ./pageC.js 2:17-31 - ./common.js 5.41 KiB [built] - cjs self exports reference ./common.js 1:0-14 - amd require ./common ./pageA.js 1:0-3:2 - amd require ./common ./pageB.js 1:0-3:2 +asset pageC.bundle.js 1.68 KiB [emitted] [minimized] (name: pageC) +asset pageA.bundle.js 1.67 KiB [emitted] [minimized] (name: pageA) +asset pageB.bundle.js 1.67 KiB [emitted] [minimized] (name: pageB) +asset 456.chunk.js 155 bytes [emitted] [minimized] +asset 394.chunk.js 104 bytes [emitted] [minimized] +chunk (runtime: pageB) pageB.bundle.js (pageB) 69 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./pageB pageB + runtime modules 4.85 KiB 6 modules + ./pageB.js 69 bytes [built] [code generated] + [no exports used] + entry ./pageB pageB +chunk (runtime: pageC) pageC.bundle.js (pageC) 68 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./pageC pageC + runtime modules 4.85 KiB 6 modules + ./pageC.js 68 bytes [built] [code generated] + [no exports used] + entry ./pageC pageC +chunk (runtime: pageC) 394.chunk.js 42 bytes [rendered] + > ./a ./pageC.js 1:0-3:2 + ./a.js 21 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./a.js 1:0-14 + cjs require ./a ./pageA.js 2:8-22 + amd require ./a ./pageC.js 1:0-3:2 + ./b.js 21 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./b.js 1:0-14 + cjs require ./b ./pageB.js 2:8-22 + cjs require ./b ./pageC.js 2:17-31 +chunk (runtime: pageA) pageA.bundle.js (pageA) 69 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./pageA pageA + runtime modules 4.85 KiB 6 modules + ./pageA.js 69 bytes [built] [code generated] + [no exports used] + entry ./pageA pageA +chunk (runtime: pageA, pageB) 456.chunk.js 5.45 KiB [rendered] + > ./common ./pageA.js 1:0-3:2 + > ./common ./pageB.js 1:0-3:2 + ./a.js 21 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./a.js 1:0-14 + cjs require ./a ./pageA.js 2:8-22 + amd require ./a ./pageC.js 1:0-3:2 + ./b.js 21 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./b.js 1:0-14 + cjs require ./b ./pageB.js 2:8-22 + cjs require ./b ./pageC.js 2:17-31 + ./common.js 5.41 KiB [built] [code generated] + [used exports unknown] + cjs self exports reference ./common.js 1:0-14 + amd require ./common ./pageA.js 1:0-3:2 + amd require ./common ./pageB.js 1:0-3:2 +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/asset-advanced/README.md b/examples/asset-advanced/README.md index a7b128f09..a744f7dbb 100644 --- a/examples/asset-advanced/README.md +++ b/examples/asset-advanced/README.md @@ -74,65 +74,16 @@ module.exports = { /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ([ -/* 0 */, -/* 1 */ -/*!*************************!*\ - !*** ./images/file.svg ***! - \*************************/ -/*! default exports */ -/*! exports [not provided] [maybe used (runtime-defined)] */ -/*! runtime requirements: module */ -/***/ ((module) => { - -module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.or...3c/svg%3e"; - -/***/ }) -/******/ ]); -``` - -
/* webpack runtime code */ - -```js -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; // The require function -/******/ -/******/ /******/ function __webpack_require__(moduleId) { - /******/ // Check if module is in cache - /******/ if (__webpack_module_cache__[moduleId]) { - /******/ return __webpack_module_cache__[moduleId].exports; - /******/ - } // Create a new module (and put it into the cache) - /******/ /******/ var module = (__webpack_module_cache__[moduleId] = { - /******/ // no module.id needed - /******/ // no module.loaded needed - /******/ exports: {} - /******/ - }); // Execute the module function - /******/ - /******/ /******/ __webpack_modules__[moduleId]( - module, - module.exports, - __webpack_require__ - ); // Return the exports of the module - /******/ - /******/ /******/ return module.exports; - /******/ -} -/******/ -/************************************************************************/ -``` - -
- -```js -(() => { +/* 0 */ /*!********************!*\ !*** ./example.js ***! \********************/ /*! namespace exports */ -/*! exports [not provided] [unused] */ -/*! runtime requirements: __webpack_require__ */ +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); /* harmony import */ var _images_file_svg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./images/file.svg */ 1); @@ -163,8 +114,72 @@ function createImageElement(title, src) { createImageElement(src.split(".").pop(), src); }); -})(); +/***/ }), +/* 1 */ +/*!*************************!*\ + !*** ./images/file.svg ***! + \*************************/ +/*! default exports */ +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: module */ +/***/ ((module) => { + +module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.or...3c/svg%3e"; + +/***/ }) +/******/ ]); +``` + +
/* webpack runtime code */ + +``` js +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ if(__webpack_module_cache__[moduleId]) { +/******/ return __webpack_module_cache__[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +``` + +
+ +``` js +/******/ // startup +/******/ // Load entry module +/******/ __webpack_require__(0); +/******/ // This entry module used 'exports' so it can't be inlined /******/ })() ; ``` @@ -174,19 +189,14 @@ function createImageElement(title, src) { ## webpack output ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -output.js 3.02 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 1.54 KiB [entry] [rendered] - > ./example.js main - ./example.js 658 bytes [built] - [no exports] - [no exports used] - entry ./example.js main - ./images/file.svg 915 bytes [built] - [no exports] - harmony side effect evaluation ./images/file.svg ./example.js 1:0-36 - harmony import specifier ./images/file.svg ./example.js 26:1-4 +asset output.js 3.86 KiB [emitted] (name: main) +chunk output.js (main) 1.54 KiB (javascript) 274 bytes (runtime) [entry] [rendered] + > ./example.js main + dependent modules 915 bytes [dependent] 1 module + runtime modules 274 bytes 1 module + ./example.js 658 bytes [built] [code generated] + [no exports] + [used exports unknown] + entry ./example.js main +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/asset-simple/README.md b/examples/asset-simple/README.md index 0de60dbd6..ca452312b 100644 --- a/examples/asset-simple/README.md +++ b/examples/asset-simple/README.md @@ -61,95 +61,16 @@ module.exports = { /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ([ -/* 0 */, -/* 1 */ -/*!*************************!*\ - !*** ./images/file.png ***! - \*************************/ -/*! default exports */ -/*! exports [not provided] [maybe used (runtime-defined)] */ -/*! runtime requirements: module, __webpack_require__.p, __webpack_require__.* */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports = __webpack_require__.p + "images/11744e207f673e90d075.png"; - -/***/ }), -/* 2 */ -/*!*************************!*\ - !*** ./images/file.jpg ***! - \*************************/ -/*! default exports */ -/*! exports [not provided] [maybe used (runtime-defined)] */ -/*! runtime requirements: module */ -/***/ ((module) => { - -module.exports = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAA...4CD/9M//Z"; - -/***/ }), -/* 3 */ -/*!*************************!*\ - !*** ./images/file.svg ***! - \*************************/ -/*! default exports */ -/*! exports [not provided] [maybe used (runtime-defined)] */ -/*! runtime requirements: module */ -/***/ ((module) => { - -module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDo...vc3ZnPgo="; - -/***/ }) -/******/ ]); -``` - -
/* webpack runtime code */ - -```js -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; // The require function -/******/ -/******/ /******/ function __webpack_require__(moduleId) { - /******/ // Check if module is in cache - /******/ if (__webpack_module_cache__[moduleId]) { - /******/ return __webpack_module_cache__[moduleId].exports; - /******/ - } // Create a new module (and put it into the cache) - /******/ /******/ var module = (__webpack_module_cache__[moduleId] = { - /******/ // no module.id needed - /******/ // no module.loaded needed - /******/ exports: {} - /******/ - }); // Execute the module function - /******/ - /******/ /******/ __webpack_modules__[moduleId]( - module, - module.exports, - __webpack_require__ - ); // Return the exports of the module - /******/ - /******/ /******/ return module.exports; - /******/ -} /* webpack/runtime/publicPath */ -/******/ -/************************************************************************/ -/******/ /******/ (() => { - /******/ __webpack_require__.p = "dist/"; - /******/ -})(); -/******/ -/************************************************************************/ -``` - -
- -```js -(() => { +/* 0 */ /*!********************!*\ !*** ./example.js ***! \********************/ /*! namespace exports */ -/*! exports [not provided] [unused] */ -/*! runtime requirements: __webpack_require__ */ +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); /* harmony import */ var _images_file_png__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./images/file.png */ 1); /* harmony import */ var _images_file_jpg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./images/file.jpg */ 2); /* harmony import */ var _images_file_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./images/file.svg */ 3); @@ -184,8 +105,101 @@ function createImageElement(title, src) { createImageElement(src.split(".").pop(), src); }); -})(); +/***/ }), +/* 1 */ +/*!*************************!*\ + !*** ./images/file.png ***! + \*************************/ +/*! default exports */ +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: module, __webpack_require__.p, __webpack_require__.* */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = __webpack_require__.p + "images/89a353e9c515885abd8e.png"; + +/***/ }), +/* 2 */ +/*!*************************!*\ + !*** ./images/file.jpg ***! + \*************************/ +/*! default exports */ +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: module */ +/***/ ((module) => { + +module.exports = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAA...4CD/9M//Z"; + +/***/ }), +/* 3 */ +/*!*************************!*\ + !*** ./images/file.svg ***! + \*************************/ +/*! default exports */ +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: module */ +/***/ ((module) => { + +module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDo...vc3ZnPgo="; + +/***/ }) +/******/ ]); +``` + +
/* webpack runtime code */ + +``` js +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ if(__webpack_module_cache__[moduleId]) { +/******/ return __webpack_module_cache__[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/publicPath */ +/******/ (() => { +/******/ __webpack_require__.p = "dist/"; +/******/ })(); +/******/ +/************************************************************************/ +``` + +
+ +``` js +/******/ // startup +/******/ // Load entry module +/******/ __webpack_require__(0); +/******/ // This entry module used 'exports' so it can't be inlined /******/ })() ; ``` @@ -195,29 +209,15 @@ function createImageElement(title, src) { ## webpack output ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -images/11744e207f673e90d075.png 14.6 KiB [emitted] [immutable] [name: (main)] - output.js 12.3 KiB [emitted] [name: main] -Entrypoint main = output.js (images/11744e207f673e90d075.png) -chunk output.js (main) 9.58 KiB (javascript) 14.6 KiB (asset) 32 bytes (runtime) [entry] [rendered] - > ./example.js main - ./example.js 742 bytes [built] - [no exports] - [no exports used] - entry ./example.js main - ./images/file.jpg 7.92 KiB [built] - [no exports] - harmony side effect evaluation ./images/file.jpg ./example.js 2:0-36 - harmony import specifier ./images/file.jpg ./example.js 28:6-9 - ./images/file.png 42 bytes (javascript) 14.6 KiB (asset) [built] - [no exports] - harmony side effect evaluation ./images/file.png ./example.js 1:0-36 - harmony import specifier ./images/file.png ./example.js 28:1-4 - ./images/file.svg 915 bytes [built] - [no exports] - harmony side effect evaluation ./images/file.svg ./example.js 3:0-36 - harmony import specifier ./images/file.svg ./example.js 28:11-14 - + 1 hidden chunk module +asset images/89a353e9c515885abd8e.png 14.6 KiB [emitted] [immutable] (auxiliary name: main) +asset output.js 13 KiB [emitted] (name: main) +chunk output.js (main) 9.58 KiB (javascript) 14.6 KiB (asset) 306 bytes (runtime) [entry] [rendered] + > ./example.js main + dependent modules 8.86 KiB (javascript) 14.6 KiB (asset) [dependent] 3 modules + runtime modules 306 bytes 2 modules + ./example.js 742 bytes [built] [code generated] + [no exports] + [used exports unknown] + entry ./example.js main +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/chunkhash/README.md b/examples/chunkhash/README.md index 4585395b3..21b0be7c5 100644 --- a/examples/chunkhash/README.md +++ b/examples/chunkhash/README.md @@ -43,7 +43,7 @@ module.exports = { @@ -152,6 +152,52 @@ module.exports = { /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) /******/ })(); /******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName("script"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute("src") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute("nonce", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ if(prev) return prev(event); +/******/ } +/******/ ; +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports @@ -170,11 +216,13 @@ module.exports = { /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // 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 +/******/ 1: 0 /******/ }; /******/ /******/ var deferredModules = [ @@ -198,49 +246,24 @@ module.exports = { /******/ /******/ // start chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); -/******/ var loadingEnded = () => { +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { /******/ if(__webpack_require__.o(installedChunks, chunkId)) { /******/ installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; -/******/ if(installedChunkData) return installedChunkData[1]; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } /******/ } /******/ }; -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = url; -/******/ -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ onScriptComplete = (event) => { -/******/ onScriptComplete = () => { -/******/ -/******/ } -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var reportError = loadingEnded(); -/******/ if(reportError) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ reportError(error); -/******/ } -/******/ } -/******/ ; -/******/ var timeout = setTimeout(() => { -/******/ onScriptComplete({ type: 'timeout', target: script }) -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -284,17 +307,14 @@ module.exports = { /******/ __webpack_require__.x = () => { /******/ /******/ } -/******/ jsonpArray = jsonpArray.slice(); -/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); +/******/ chunkLoadingGlobal = chunkLoadingGlobal.slice(); +/******/ for(var i = 0; i < chunkLoadingGlobal.length; i++) webpackJsonpCallback(chunkLoadingGlobal[i]); /******/ return (checkDeferredModules = checkDeferredModulesImpl)(); /******/ }; /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ var executeModules = data[2]; -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime, executeModules] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -311,7 +331,7 @@ module.exports = { /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } @@ -321,12 +341,11 @@ module.exports = { /******/ /******/ // run deferred modules when all chunks ready /******/ return checkDeferredModules(); -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -344,13 +363,12 @@ module.exports = { # dist/main.[chunkhash].js ```javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[1],[ +(self["webpackChunk"] = self["webpackChunk"] || []).push([[0],[ /* 0 */ /*!********************!*\ !*** ./example.js ***! \********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [unused] */ /*! runtime requirements: __webpack_require__.e, __webpack_require__.t, __webpack_require__.* */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { @@ -360,7 +378,8 @@ __webpack_require__.e(/*! import() */ 3).then(__webpack_require__.t.bind(__webpa /***/ }) -],[[0,0]]]); +], +0,[[0,1]]]); ``` # Info @@ -368,57 +387,57 @@ __webpack_require__.e(/*! import() */ 3).then(__webpack_require__.t.bind(__webpa ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size - 2.[chunkhash].js 370 bytes [emitted] - 3.[chunkhash].js 364 bytes [emitted] - main.[chunkhash].js 710 bytes [emitted] [name: main] -runtime~main.[chunkhash].js 10.9 KiB [emitted] [name: runtime~main] -Entrypoint main = runtime~main.[chunkhash].js main.[chunkhash].js -chunk runtime~main.[chunkhash].js (runtime~main) 6.59 KiB [entry] [rendered] - > ./example main - 8 chunk modules +asset runtime~main.[chunkhash].js 11.9 KiB [emitted] (name: runtime~main) +asset main.[chunkhash].js 650 bytes [emitted] (name: main) +asset 2.[chunkhash].js 285 bytes [emitted] +asset 3.[chunkhash].js 279 bytes [emitted] +Entrypoint main 12.5 KiB = runtime~main.[chunkhash].js 11.9 KiB main.[chunkhash].js 650 bytes chunk main.[chunkhash].js (main) 55 bytes [initial] [rendered] - > ./example main - ./example.js 55 bytes [built] - [no exports used] - entry ./example main + > ./example main + ./example.js 55 bytes [built] [code generated] + [used exports unknown] + entry ./example main +chunk runtime~main.[chunkhash].js (runtime~main) 7.27 KiB [entry] [rendered] + > ./example main + runtime modules 7.27 KiB 9 modules chunk 2.[chunkhash].js 28 bytes [rendered] - > ./async1 ./example.js 2:0-18 - ./async1.js 28 bytes [built] - import() ./async1 ./example.js 2:0-18 + > ./async1 ./example.js 2:0-18 + ./async1.js 28 bytes [built] [code generated] + [used exports unknown] + import() ./async1 ./example.js 2:0-18 chunk 3.[chunkhash].js 28 bytes [rendered] - > ./async2 ./example.js 3:0-18 - ./async2.js 28 bytes [built] - import() ./async2 ./example.js 3:0-18 + > ./async2 ./example.js 3:0-18 + ./async2.js 28 bytes [built] [code generated] + [used exports unknown] + import() ./async2 ./example.js 3:0-18 +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size - 114.[chunkhash].js 73 bytes [emitted] - 172.[chunkhash].js 73 bytes [emitted] - main.[chunkhash].js 155 bytes [emitted] [name: main] -runtime~main.[chunkhash].js 2.11 KiB [emitted] [name: runtime~main] -Entrypoint main = runtime~main.[chunkhash].js main.[chunkhash].js -chunk 114.[chunkhash].js 28 bytes [rendered] - > ./async1 ./example.js 2:0-18 - ./async1.js 28 bytes [built] - import() ./async1 ./example.js 2:0-18 -chunk 172.[chunkhash].js 28 bytes [rendered] - > ./async2 ./example.js 3:0-18 - ./async2.js 28 bytes [built] - import() ./async2 ./example.js 3:0-18 -chunk main.[chunkhash].js (main) 55 bytes [initial] [rendered] - > ./example main - ./example.js 55 bytes [built] - [no exports used] - entry ./example main -chunk runtime~main.[chunkhash].js (runtime~main) 6.6 KiB [entry] [rendered] - > ./example main - 8 chunk modules +asset runtime~main.[chunkhash].js 2.42 KiB [emitted] [minimized] (name: runtime~main) +asset main.[chunkhash].js 153 bytes [emitted] [minimized] (name: main) +asset 114.[chunkhash].js 69 bytes [emitted] [minimized] +asset 172.[chunkhash].js 69 bytes [emitted] [minimized] +Entrypoint main 2.56 KiB = runtime~main.[chunkhash].js 2.42 KiB main.[chunkhash].js 153 bytes +chunk (runtime: runtime~main) 114.[chunkhash].js 28 bytes [rendered] + > ./async1 ./example.js 2:0-18 + ./async1.js 28 bytes [built] [code generated] + [used exports unknown] + import() ./async1 ./example.js 2:0-18 +chunk (runtime: runtime~main) 172.[chunkhash].js 28 bytes [rendered] + > ./async2 ./example.js 3:0-18 + ./async2.js 28 bytes [built] [code generated] + [used exports unknown] + import() ./async2 ./example.js 3:0-18 +chunk (runtime: runtime~main) main.[chunkhash].js (main) 55 bytes [initial] [rendered] + > ./example main + ./example.js 55 bytes [built] [code generated] + [no exports used] + entry ./example main +chunk (runtime: runtime~main) runtime~main.[chunkhash].js (runtime~main) 7.27 KiB [entry] [rendered] + > ./example main + runtime modules 7.27 KiB 9 modules +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/cjs-tree-shaking/README.md b/examples/cjs-tree-shaking/README.md index b59f450ff..28cc828c8 100644 --- a/examples/cjs-tree-shaking/README.md +++ b/examples/cjs-tree-shaking/README.md @@ -59,9 +59,8 @@ exports.multiply = function multiply() { \**********************/ /*! default exports */ /*! export decrement [provided] [unused] [renamed to Mj] */ -/*! export increment [provided] [used] [renamed to nP] */ +/*! export increment [provided] [used in main] [renamed to nP] */ /*! export incrementBy2 [provided] [unused] [renamed to pN] */ -/*! other exports [not provided] [unused] */ /*! runtime requirements: __webpack_require__, __webpack_exports__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { @@ -84,9 +83,8 @@ __webpack_unused_export__ = function decrement(val) { !*** ./math.js ***! \*****************/ /*! default exports */ -/*! export add [provided] [used] [renamed to I] */ +/*! export add [provided] [used in main] [renamed to I] */ /*! export multiply [provided] [unused] [renamed to J] */ -/*! other exports [not provided] [unused] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { @@ -156,7 +154,6 @@ __webpack_unused_export__ = function multiply() { !*** ./example.js ***! \********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [unused] */ /*! runtime requirements: __webpack_require__ */ const inc = __webpack_require__(/*! ./increment */ 1)/* .increment */ .nP; var a = 1; @@ -172,14 +169,14 @@ inc(a); // 2 ```javascript /*! For license information please see output.js.LICENSE.txt */ -(()=>{var r=[,(r,n,t)=>{const e=t(2).I;n.nP=function(r){return e(r,1)}},(r,n)=>{n.I=function(){for(var r=0,n=0,t=arguments,e=t.length;n{var r=[,(r,n,t)=>{const e=t(2).I;n.nP=function(r){return e(r,1)}},(r,n)=>{n.I=function(){for(var r=0,n=0,t=arguments,e=t.length;n{var n=[,(n,r,t)=>{const e=t(2).add;r.increment=function(n){return e(n,1)},r.incrementBy2=function(n){return e(n,2)},r.decrement=function(n){return e(n,1)}},(n,r)=>{r.add=function(){for(var n=0,r=0,t=arguments,e=t.length;r{var n=[,(n,r,t)=>{const e=t(2).add;r.increment=function(n){return e(n,1)},r.incrementBy2=function(n){return e(n,2)},r.decrement=function(n){return e(n,1)}},(n,r)=>{r.add=function(){for(var n=0,r=0,t=arguments,e=t.length;r ./example.js main - ./example.js 70 bytes [built] - [no exports used] - entry ./example.js main - ./increment.js 251 bytes [built] - [exports: decrement, increment, incrementBy2] - [only some exports used: increment] - cjs full require ./increment ./example.js 1:12-44 - ./math.js 313 bytes [built] - [exports: add, multiply] - [only some exports used: add] - cjs full require ./math ./increment.js 1:12-33 -Child - Hash: 0a1b2c3d4e5f6a7b8c9d - Asset Size - without.js 2.97 KiB [emitted] [name: main] - Entrypoint main = without.js - chunk without.js (main) 634 bytes [entry] [rendered] - > ./example.js main - ./example.js 70 bytes [built] - [used exports unknown] - entry ./example.js main - ./increment.js 251 bytes [built] - [exports: decrement, increment, incrementBy2] - [used exports unknown] - cjs full require ./increment ./example.js 1:12-44 - ./math.js 313 bytes [built] - [exports: add, multiply] - [used exports unknown] - cjs full require ./math ./increment.js 1:12-33 +asset output.js 2.76 KiB [emitted] (name: main) +chunk (runtime: main) output.js (main) 634 bytes [entry] [rendered] + > ./example.js main + dependent modules 564 bytes [dependent] 2 modules + ./example.js 70 bytes [built] [code generated] + [no exports used] + entry ./example.js main +webpack 5.0.0-beta.32 compiled successfully + +asset without.js 2.91 KiB [emitted] (name: main) +chunk without.js (main) 634 bytes [entry] [rendered] + > ./example.js main + dependent modules 564 bytes [dependent] 2 modules + ./example.js 70 bytes [built] [code generated] + [used exports unknown] + entry ./example.js main +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 -Child - Hash: 0a1b2c3d4e5f6a7b8c9d - Asset Size - output.js 352 bytes [emitted] [name: main] - output.js.LICENSE.txt 745 bytes [emitted] - Entrypoint main = output.js - chunk output.js (main) 634 bytes [entry] [rendered] - > ./example.js main - ./example.js 70 bytes [built] - [no exports used] - entry ./example.js main - ./increment.js 251 bytes [built] - [exports: decrement, increment, incrementBy2] - [only some exports used: increment] - cjs full require ./increment ./example.js 1:12-44 - ./math.js 313 bytes [built] - [exports: add, multiply] - [only some exports used: add] - cjs full require ./math ./increment.js 1:12-33 -Child - Hash: 0a1b2c3d4e5f6a7b8c9d - Asset Size - without.js 538 bytes [emitted] [name: main] - without.js.LICENSE.txt 908 bytes [emitted] - Entrypoint main = without.js - chunk without.js (main) 634 bytes [entry] [rendered] - > ./example.js main - ./example.js 70 bytes [built] - [used exports unknown] - entry ./example.js main - ./increment.js 251 bytes [built] - [exports: decrement, increment, incrementBy2] - [used exports unknown] - cjs full require ./increment ./example.js 1:12-44 - ./math.js 313 bytes [built] - [exports: add, multiply] - [used exports unknown] - cjs full require ./math ./increment.js 1:12-33 +asset output.js 351 bytes [emitted] [minimized] (name: main) 1 related asset +chunk (runtime: main) output.js (main) 634 bytes [entry] [rendered] + > ./example.js main + dependent modules 564 bytes [dependent] 2 modules + ./example.js 70 bytes [built] [code generated] + [no exports used] + entry ./example.js main +webpack 5.0.0-beta.32 compiled successfully + +asset without.js 537 bytes [emitted] [minimized] (name: main) 1 related asset +chunk without.js (main) 634 bytes [entry] [rendered] + > ./example.js main + dependent modules 564 bytes [dependent] 2 modules + ./example.js 70 bytes [built] [code generated] + [used exports unknown] + entry ./example.js main +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/code-splitted-require.context-amd/README.md b/examples/code-splitted-require.context-amd/README.md index 4d791a634..112b66eeb 100644 --- a/examples/code-splitted-require.context-amd/README.md +++ b/examples/code-splitted-require.context-amd/README.md @@ -79,6 +79,52 @@ getTemplate("b", function(b) { /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) /******/ })(); /******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName("script"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute("src") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute("nonce", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ if(prev) return prev(event); +/******/ } +/******/ ; +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/publicPath */ /******/ (() => { /******/ __webpack_require__.p = "dist/"; @@ -86,6 +132,8 @@ getTemplate("b", function(b) { /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -112,49 +160,24 @@ getTemplate("b", function(b) { /******/ /******/ // start chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); -/******/ var loadingEnded = () => { +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { /******/ if(__webpack_require__.o(installedChunks, chunkId)) { /******/ installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; -/******/ if(installedChunkData) return installedChunkData[1]; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } /******/ } /******/ }; -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = url; -/******/ -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ onScriptComplete = (event) => { -/******/ onScriptComplete = () => { -/******/ -/******/ } -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var reportError = loadingEnded(); -/******/ if(reportError) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ reportError(error); -/******/ } -/******/ } -/******/ ; -/******/ var timeout = setTimeout(() => { -/******/ onScriptComplete({ type: 'timeout', target: script }) -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -171,11 +194,8 @@ getTemplate("b", function(b) { /******/ // no deferred startup /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -192,17 +212,16 @@ getTemplate("b", function(b) { /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } /******/ -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -215,7 +234,6 @@ getTemplate("b", function(b) { !*** ./example.js ***! \********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [unused] */ /*! runtime requirements: __webpack_require__.e, __webpack_require__.oe, __webpack_require__, __webpack_require__.* */ function getTemplate(templateName, callback) { __webpack_require__.e(/*! AMD require */ 577).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(1)("./"+templateName)]; (function(tmpl) { @@ -235,14 +253,14 @@ getTemplate("b", function(b) { # dist/577.output.js ``` javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[577],[ +(self["webpackChunk"] = self["webpackChunk"] || []).push([[577],[ /* 0 */, /* 1 */ -/*!**************************************************!*\ - !*** ../require.context/templates sync ^\.\/.*$ ***! - \**************************************************/ -/*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ +/*!***************************************************!*\ + !*** ../require.context/templates/ sync ^\.\/.*$ ***! + \***************************************************/ +/*! default exports */ +/*! exports [not provided] [no usage info] */ /*! runtime requirements: module, __webpack_require__.o, __webpack_require__ */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { @@ -281,8 +299,8 @@ webpackContext.id = 1; !*** ../require.context/templates/a.js ***! \*****************************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = function() { @@ -295,8 +313,8 @@ module.exports = function() { !*** ../require.context/templates/b.js ***! \*****************************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = function() { @@ -309,8 +327,8 @@ module.exports = function() { !*** ../require.context/templates/c.js ***! \*****************************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = function() { @@ -326,65 +344,40 @@ module.exports = function() { ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -577.output.js 2.33 KiB [emitted] - output.js 8.05 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 251 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 251 bytes [built] - [no exports used] - entry ./example.js main - + 5 hidden chunk modules +asset output.js 8.9 KiB [emitted] (name: main) +asset 577.output.js 2.23 KiB [emitted] +chunk output.js (main) 251 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 4.85 KiB 6 modules + ./example.js 251 bytes [built] [code generated] + [used exports unknown] + entry ./example.js main chunk 577.output.js 457 bytes [rendered] - > ./example.js 2:1-4:3 - ../require.context/templates sync ^\.\/.*$ 217 bytes [built] - amd require context ../require.context/templates ./example.js 2:1-4:3 - ../require.context/templates/a.js 80 bytes [built] - cjs self exports reference ../require.context/templates/a.js 1:0-14 - context element ./a ../require.context/templates sync ^\.\/.*$ ./a - context element ./a.js ../require.context/templates sync ^\.\/.*$ ./a.js - ../require.context/templates/b.js 80 bytes [built] - cjs self exports reference ../require.context/templates/b.js 1:0-14 - context element ./b ../require.context/templates sync ^\.\/.*$ ./b - context element ./b.js ../require.context/templates sync ^\.\/.*$ ./b.js - ../require.context/templates/c.js 80 bytes [built] - cjs self exports reference ../require.context/templates/c.js 1:0-14 - context element ./c ../require.context/templates sync ^\.\/.*$ ./c - context element ./c.js ../require.context/templates sync ^\.\/.*$ ./c.js + > ./example.js 2:1-4:3 + dependent modules 240 bytes [dependent] 3 modules + ../require.context/templates/ sync ^\.\/.*$ 217 bytes [built] [code generated] + [no exports] + [used exports unknown] + amd require context ./example.js 2:1-4:3 +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -577.output.js 613 bytes [emitted] - output.js 1.45 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 251 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 251 bytes [built] - [no exports used] - entry ./example.js main - + 5 hidden chunk modules -chunk 577.output.js 457 bytes [rendered] - > ./example.js 2:1-4:3 - ../require.context/templates sync ^\.\/.*$ 217 bytes [built] - amd require context ../require.context/templates ./example.js 2:1-4:3 - ../require.context/templates/a.js 80 bytes [built] - cjs self exports reference ../require.context/templates/a.js 1:0-14 - context element ./a ../require.context/templates sync ^\.\/.*$ ./a - context element ./a.js ../require.context/templates sync ^\.\/.*$ ./a.js - ../require.context/templates/b.js 80 bytes [built] - cjs self exports reference ../require.context/templates/b.js 1:0-14 - context element ./b ../require.context/templates sync ^\.\/.*$ ./b - context element ./b.js ../require.context/templates sync ^\.\/.*$ ./b.js - ../require.context/templates/c.js 80 bytes [built] - cjs self exports reference ../require.context/templates/c.js 1:0-14 - context element ./c ../require.context/templates sync ^\.\/.*$ ./c - context element ./c.js ../require.context/templates sync ^\.\/.*$ ./c.js +asset output.js 1.76 KiB [emitted] [minimized] (name: main) +asset 577.output.js 609 bytes [emitted] [minimized] +chunk (runtime: main) output.js (main) 251 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 4.85 KiB 6 modules + ./example.js 251 bytes [built] [code generated] + [no exports used] + entry ./example.js main +chunk (runtime: main) 577.output.js 457 bytes [rendered] + > ./example.js 2:1-4:3 + dependent modules 240 bytes [dependent] 3 modules + ../require.context/templates/ sync ^\.\/.*$ 217 bytes [built] [code generated] + [no exports] + amd require context ./example.js 2:1-4:3 +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/code-splitted-require.context/README.md b/examples/code-splitted-require.context/README.md index 210a332a4..448fceb17 100644 --- a/examples/code-splitted-require.context/README.md +++ b/examples/code-splitted-require.context/README.md @@ -79,6 +79,52 @@ getTemplate("b", function(b) { /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) /******/ })(); /******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName("script"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute("src") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute("nonce", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ if(prev) return prev(event); +/******/ } +/******/ ; +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/publicPath */ /******/ (() => { /******/ __webpack_require__.p = "dist/"; @@ -86,6 +132,8 @@ getTemplate("b", function(b) { /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -112,49 +160,24 @@ getTemplate("b", function(b) { /******/ /******/ // start chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); -/******/ var loadingEnded = () => { +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { /******/ if(__webpack_require__.o(installedChunks, chunkId)) { /******/ installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; -/******/ if(installedChunkData) return installedChunkData[1]; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } /******/ } /******/ }; -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = url; -/******/ -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ onScriptComplete = (event) => { -/******/ onScriptComplete = () => { -/******/ -/******/ } -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var reportError = loadingEnded(); -/******/ if(reportError) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ reportError(error); -/******/ } -/******/ } -/******/ ; -/******/ var timeout = setTimeout(() => { -/******/ onScriptComplete({ type: 'timeout', target: script }) -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -171,11 +194,8 @@ getTemplate("b", function(b) { /******/ // no deferred startup /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -192,17 +212,16 @@ getTemplate("b", function(b) { /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } /******/ -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -215,7 +234,6 @@ getTemplate("b", function(b) { !*** ./example.js ***! \********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [unused] */ /*! runtime requirements: __webpack_require__.e, __webpack_require__, __webpack_require__.* */ function getTemplate(templateName, callback) { __webpack_require__.e(/*! require.ensure */ 577).then((function(require) { @@ -235,14 +253,14 @@ getTemplate("b", function(b) { # dist/577.output.js ``` javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[577],[ +(self["webpackChunk"] = self["webpackChunk"] || []).push([[577],[ /* 0 */, /* 1 */ -/*!**************************************************!*\ - !*** ../require.context/templates sync ^\.\/.*$ ***! - \**************************************************/ -/*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ +/*!***************************************************!*\ + !*** ../require.context/templates/ sync ^\.\/.*$ ***! + \***************************************************/ +/*! default exports */ +/*! exports [not provided] [no usage info] */ /*! runtime requirements: module, __webpack_require__.o, __webpack_require__ */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { @@ -281,8 +299,8 @@ webpackContext.id = 1; !*** ../require.context/templates/a.js ***! \*****************************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = function() { @@ -295,8 +313,8 @@ module.exports = function() { !*** ../require.context/templates/b.js ***! \*****************************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = function() { @@ -309,8 +327,8 @@ module.exports = function() { !*** ../require.context/templates/c.js ***! \*****************************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = function() { @@ -326,65 +344,40 @@ module.exports = function() { ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -577.output.js 2.33 KiB [emitted] - output.js 7.96 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 266 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 266 bytes [built] - [no exports used] - entry ./example.js main - + 5 hidden chunk modules +asset output.js 8.81 KiB [emitted] (name: main) +asset 577.output.js 2.23 KiB [emitted] +chunk output.js (main) 266 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 4.85 KiB 6 modules + ./example.js 266 bytes [built] [code generated] + [used exports unknown] + entry ./example.js main chunk 577.output.js 457 bytes [rendered] - > ./example.js 2:1-4:3 - ../require.context/templates sync ^\.\/.*$ 217 bytes [built] - cjs require context ../require.context/templates ./example.js 3:11-64 - ../require.context/templates/a.js 80 bytes [built] - cjs self exports reference ../require.context/templates/a.js 1:0-14 - context element ./a ../require.context/templates sync ^\.\/.*$ ./a - context element ./a.js ../require.context/templates sync ^\.\/.*$ ./a.js - ../require.context/templates/b.js 80 bytes [built] - cjs self exports reference ../require.context/templates/b.js 1:0-14 - context element ./b ../require.context/templates sync ^\.\/.*$ ./b - context element ./b.js ../require.context/templates sync ^\.\/.*$ ./b.js - ../require.context/templates/c.js 80 bytes [built] - cjs self exports reference ../require.context/templates/c.js 1:0-14 - context element ./c ../require.context/templates sync ^\.\/.*$ ./c - context element ./c.js ../require.context/templates sync ^\.\/.*$ ./c.js + > ./example.js 2:1-4:3 + dependent modules 240 bytes [dependent] 3 modules + ../require.context/templates/ sync ^\.\/.*$ 217 bytes [built] [code generated] + [no exports] + [used exports unknown] + cjs require context ./example.js 3:11-64 +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -577.output.js 613 bytes [emitted] - output.js 1.42 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 266 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 266 bytes [built] - [no exports used] - entry ./example.js main - + 5 hidden chunk modules -chunk 577.output.js 457 bytes [rendered] - > ./example.js 2:1-4:3 - ../require.context/templates sync ^\.\/.*$ 217 bytes [built] - cjs require context ../require.context/templates ./example.js 3:11-64 - ../require.context/templates/a.js 80 bytes [built] - cjs self exports reference ../require.context/templates/a.js 1:0-14 - context element ./a ../require.context/templates sync ^\.\/.*$ ./a - context element ./a.js ../require.context/templates sync ^\.\/.*$ ./a.js - ../require.context/templates/b.js 80 bytes [built] - cjs self exports reference ../require.context/templates/b.js 1:0-14 - context element ./b ../require.context/templates sync ^\.\/.*$ ./b - context element ./b.js ../require.context/templates sync ^\.\/.*$ ./b.js - ../require.context/templates/c.js 80 bytes [built] - cjs self exports reference ../require.context/templates/c.js 1:0-14 - context element ./c ../require.context/templates sync ^\.\/.*$ ./c - context element ./c.js ../require.context/templates sync ^\.\/.*$ ./c.js +asset output.js 1.74 KiB [emitted] [minimized] (name: main) +asset 577.output.js 609 bytes [emitted] [minimized] +chunk (runtime: main) output.js (main) 266 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 4.85 KiB 6 modules + ./example.js 266 bytes [built] [code generated] + [no exports used] + entry ./example.js main +chunk (runtime: main) 577.output.js 457 bytes [rendered] + > ./example.js 2:1-4:3 + dependent modules 240 bytes [dependent] 3 modules + ../require.context/templates/ sync ^\.\/.*$ 217 bytes [built] [code generated] + [no exports] + cjs require context ./example.js 3:11-64 +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/code-splitting-bundle-loader/README.md b/examples/code-splitting-bundle-loader/README.md index 1d20b5657..739ce3f06 100644 --- a/examples/code-splitting-bundle-loader/README.md +++ b/examples/code-splitting-bundle-loader/README.md @@ -27,8 +27,8 @@ module.exports = "It works"; !*** ../../node_modules/bundle-loader/index.js!./file.js ***! \***********************************************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module, __webpack_require__, __webpack_require__.e, __webpack_require__.* */ +/*! CommonJS bailout: module.exports is used directly at 3:0-14 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var cbs = [], @@ -108,6 +108,52 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) /******/ })(); /******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName("script"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute("src") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute("nonce", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ if(prev) return prev(event); +/******/ } +/******/ ; +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/publicPath */ /******/ (() => { /******/ __webpack_require__.p = "dist/"; @@ -115,6 +161,8 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -141,49 +189,24 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ /******/ // start chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); -/******/ var loadingEnded = () => { +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { /******/ if(__webpack_require__.o(installedChunks, chunkId)) { /******/ installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; -/******/ if(installedChunkData) return installedChunkData[1]; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } /******/ } /******/ }; -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = url; -/******/ -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ onScriptComplete = (event) => { -/******/ onScriptComplete = () => { -/******/ -/******/ } -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var reportError = loadingEnded(); -/******/ if(reportError) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ reportError(error); -/******/ } -/******/ } -/******/ ; -/******/ var timeout = setTimeout(() => { -/******/ onScriptComplete({ type: 'timeout', target: script }) -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -200,11 +223,8 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ // no deferred startup /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -221,17 +241,16 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } /******/ -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -245,7 +264,6 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { !*** ./example.js ***! \********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [unused] */ /*! runtime requirements: __webpack_require__ */ __webpack_require__(/*! bundle-loader!./file.js */ 1)(function(fileJsExports) { console.log(fileJsExports); @@ -260,15 +278,15 @@ __webpack_require__(/*! bundle-loader!./file.js */ 1)(function(fileJsExports) { # dist/929.output.js ```javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[929],{ +(self["webpackChunk"] = self["webpackChunk"] || []).push([[929],{ /***/ 2: /*!*****************!*\ !*** ./file.js ***! \*****************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = "It works"; @@ -283,49 +301,41 @@ module.exports = "It works"; ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -929.output.js 372 bytes [emitted] - output.js 8.6 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 375 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./example.js main - ../../node_modules/bundle-loader/index.js!./file.js 281 bytes [built] - cjs require bundle-loader!./file.js ./example.js 1:0-34 - cjs self exports reference ../../node_modules/bundle-loader/index.js!./file.js 3:0-14 - ./example.js 94 bytes [built] - [no exports used] - entry ./example.js main - + 5 hidden chunk modules +asset output.js 9.44 KiB [emitted] (name: main) +asset 929.output.js 354 bytes [emitted] +chunk output.js (main) 375 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 4.85 KiB 6 modules + dependent modules 281 bytes [dependent] 1 module + ./example.js 94 bytes [built] [code generated] + [used exports unknown] + entry ./example.js main chunk 929.output.js 28 bytes [rendered] - > ../../node_modules/bundle-loader/index.js!./file.js 7:0-14:2 - ./file.js 28 bytes [built] - cjs self exports reference ./file.js 1:0-14 - cjs require !!./file.js ../../node_modules/bundle-loader/index.js!./file.js 8:8-30 + > ../../node_modules/bundle-loader/index.js!./file.js 7:0-14:2 + ./file.js 28 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./file.js 1:0-14 + cjs require !!./file.js ../../node_modules/bundle-loader/index.js!./file.js 8:8-30 +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -929.output.js 92 bytes [emitted] - output.js 1.48 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 375 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./example.js main - ../../node_modules/bundle-loader/index.js!./file.js 281 bytes [built] - cjs require bundle-loader!./file.js ./example.js 1:0-34 - cjs self exports reference ../../node_modules/bundle-loader/index.js!./file.js 3:0-14 - ./example.js 94 bytes [built] - [no exports used] - entry ./example.js main - + 5 hidden chunk modules -chunk 929.output.js 28 bytes [rendered] - > ../../node_modules/bundle-loader/index.js!./file.js 7:0-14:2 - ./file.js 28 bytes [built] - cjs self exports reference ./file.js 1:0-14 - cjs require !!./file.js ../../node_modules/bundle-loader/index.js!./file.js 8:8-30 +asset output.js 1.79 KiB [emitted] [minimized] (name: main) +asset 929.output.js 88 bytes [emitted] [minimized] +chunk (runtime: main) output.js (main) 375 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 4.85 KiB 6 modules + dependent modules 281 bytes [dependent] 1 module + ./example.js 94 bytes [built] [code generated] + [no exports used] + entry ./example.js main +chunk (runtime: main) 929.output.js 28 bytes [rendered] + > ../../node_modules/bundle-loader/index.js!./file.js 7:0-14:2 + ./file.js 28 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./file.js 1:0-14 + cjs require !!./file.js ../../node_modules/bundle-loader/index.js!./file.js 8:8-30 +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/code-splitting-depend-on-advanced/README.md b/examples/code-splitting-depend-on-advanced/README.md index dc2e96b71..f810e4eeb 100644 --- a/examples/code-splitting-depend-on-advanced/README.md +++ b/examples/code-splitting-depend-on-advanced/README.md @@ -151,6 +151,52 @@ console.log(lodash, isomorphicFetch); /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) /******/ })(); /******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName("script"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute("src") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute("nonce", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ if(prev) return prev(event); +/******/ } +/******/ ; +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports @@ -169,6 +215,8 @@ console.log(lodash, isomorphicFetch); /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -197,49 +245,24 @@ console.log(lodash, isomorphicFetch); /******/ /******/ // start chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); -/******/ var loadingEnded = () => { +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { /******/ if(__webpack_require__.o(installedChunks, chunkId)) { /******/ installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; -/******/ if(installedChunkData) return installedChunkData[1]; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } /******/ } /******/ }; -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = url; -/******/ -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ onScriptComplete = (event) => { -/******/ onScriptComplete = () => { -/******/ -/******/ } -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var reportError = loadingEnded(); -/******/ if(reportError) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ reportError(error); -/******/ } -/******/ } -/******/ ; -/******/ var timeout = setTimeout(() => { -/******/ onScriptComplete({ type: 'timeout', target: script }) -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -283,17 +306,14 @@ console.log(lodash, isomorphicFetch); /******/ __webpack_require__.x = () => { /******/ /******/ } -/******/ jsonpArray = jsonpArray.slice(); -/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); +/******/ chunkLoadingGlobal = chunkLoadingGlobal.slice(); +/******/ for(var i = 0; i < chunkLoadingGlobal.length; i++) webpackJsonpCallback(chunkLoadingGlobal[i]); /******/ return (checkDeferredModules = checkDeferredModulesImpl)(); /******/ }; /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ var executeModules = data[2]; -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime, executeModules] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -310,7 +330,7 @@ console.log(lodash, isomorphicFetch); /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } @@ -320,12 +340,11 @@ console.log(lodash, isomorphicFetch); /******/ /******/ // run deferred modules when all chunks ready /******/ return checkDeferredModules(); -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -343,18 +362,19 @@ console.log(lodash, isomorphicFetch); # dist/app.js ```javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["app"],{ +(self["webpackChunk"] = self["webpackChunk"] || []).push([["app"],{ /***/ 7: /*!****************!*\ !*** ./app.js ***! \****************/ /*! namespace exports */ -/*! exports [not provided] [unused] */ -/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.* */ -/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => { +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; +__webpack_require__.r(__webpack_exports__); /* harmony import */ var isomorphic_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! isomorphic-fetch */ 5); /* harmony import */ var isomorphic_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(isomorphic_fetch__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ 4); @@ -367,24 +387,26 @@ console.log((isomorphic_fetch__WEBPACK_IMPORTED_MODULE_0___default()), (lodash__ /***/ }) -},[[7,"runtime","other-vendors"]]]); +}, +0,[[7,"runtime","other-vendors"]]]); ``` # dist/page1.js ```javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["page1"],{ +(self["webpackChunk"] = self["webpackChunk"] || []).push([["page1"],{ /***/ 6: /*!******************!*\ !*** ./page1.js ***! \******************/ /*! namespace exports */ -/*! exports [not provided] [unused] */ -/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.e, __webpack_require__.* */ -/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => { +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.e, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; +__webpack_require__.r(__webpack_exports__); /* harmony import */ var isomorphic_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! isomorphic-fetch */ 5); /* harmony import */ var isomorphic_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(isomorphic_fetch__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 0); @@ -402,13 +424,14 @@ __webpack_require__.e(/*! import() */ "lazy_js").then(__webpack_require__.bind(_ /***/ }) -},[[6,"app","runtime","react-vendors","other-vendors"]]]); +}, +0,[[6,"app","runtime","react-vendors","other-vendors"]]]); ``` # dist/other-vendors.js ```javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["other-vendors"],[ +(self["webpackChunk"] = self["webpackChunk"] || []).push([["other-vendors"],[ /* 0 */, /* 1 */, /* 2 */, @@ -417,11 +440,12 @@ __webpack_require__.e(/*! import() */ "lazy_js").then(__webpack_require__.bind(_ !*** ./other-vendors.js ***! \**************************/ /*! namespace exports */ -/*! exports [not provided] [unused] */ -/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.* */ -/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => { +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; +__webpack_require__.r(__webpack_exports__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ 4); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var isomorphic_fetch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! isomorphic-fetch */ 5); @@ -439,8 +463,8 @@ console.log((lodash__WEBPACK_IMPORTED_MODULE_0___default()), (isomorphic_fetch__ !*** ./node_modules/lodash.js ***! \********************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = 'lodash'; @@ -452,28 +476,29 @@ module.exports = 'lodash'; !*** ./node_modules/isomorphic-fetch.js ***! \******************************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = "isomorphic-fetch"; /***/ }) -],[[3,"runtime"]]]); +], +0,[[3,"runtime"]]]); ``` # dist/react-vendors.js ```javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["react-vendors"],[ +(self["webpackChunk"] = self["webpackChunk"] || []).push([["react-vendors"],[ /* 0 */ /*!*******************************!*\ !*** ./node_modules/react.js ***! \*******************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = 'react'; @@ -485,8 +510,8 @@ module.exports = 'react'; !*** ./node_modules/react-dom.js ***! \***********************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = 'react-dom'; @@ -498,15 +523,16 @@ module.exports = 'react-dom'; !*** ./node_modules/prop-types.js ***! \************************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = 'prop-types'; /***/ }) -],[[0,"runtime"],[1,"runtime"],[2,"runtime"]]]); +], +0,[[0,"runtime"],[1,"runtime"],[2,"runtime"]]]); ``` # Info @@ -514,163 +540,136 @@ module.exports = 'prop-types'; ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size - app.js 1.09 KiB [emitted] [name: app] - lazy_js.js 1.13 KiB [emitted] -other-vendors.js 1.87 KiB [emitted] [name: other-vendors] - page1.js 1.56 KiB [emitted] [name: page1] -react-vendors.js 1.15 KiB [emitted] [name: react-vendors] - runtime.js 10.4 KiB [emitted] [name: runtime] -Entrypoint app = app.js -Entrypoint page1 = page1.js -Entrypoint react-vendors = runtime.js react-vendors.js -Entrypoint other-vendors = runtime.js other-vendors.js +asset runtime.js 11.3 KiB [emitted] (name: runtime) +asset other-vendors.js 1.92 KiB [emitted] (name: other-vendors) +asset page1.js 1.64 KiB [emitted] (name: page1) +asset app.js 1.17 KiB [emitted] (name: app) +asset lazy_js.js 1.11 KiB [emitted] +asset react-vendors.js 1.1 KiB [emitted] (name: react-vendors) +Entrypoint app 1.17 KiB = app.js +Entrypoint page1 1.64 KiB = page1.js +Entrypoint react-vendors 12.4 KiB = runtime.js 11.3 KiB react-vendors.js 1.1 KiB +Entrypoint other-vendors 13.3 KiB = runtime.js 11.3 KiB other-vendors.js 1.92 KiB chunk app.js (app) 116 bytes <{other-vendors}> <{runtime}> >{page1}< [initial] [rendered] - > ./app.js app - ./app.js 116 bytes [built] - [no exports] - [no exports used] - entry ./app.js app + > ./app.js app + ./app.js 116 bytes [built] [code generated] + [no exports] + [used exports unknown] + entry ./app.js app chunk lazy_js.js 98 bytes <{page1}> [rendered] - > ./lazy ./page1.js 7:0-16 - ./lazy.js 98 bytes [built] - [no exports] - import() ./lazy ./page1.js 7:0-16 + > ./lazy ./page1.js 7:0-16 + ./lazy.js 98 bytes [built] [code generated] + [no exports] + [used exports unknown] + import() ./lazy ./page1.js 7:0-16 chunk other-vendors.js (other-vendors) 210 bytes ={runtime}= >{app}< [initial] [rendered] - > ./other-vendors other-vendors - ./node_modules/isomorphic-fetch.js 37 bytes [built] - harmony side effect evaluation isomorphic-fetch ./app.js 1:0-47 - harmony import specifier isomorphic-fetch ./app.js 4:12-27 - cjs self exports reference ./node_modules/isomorphic-fetch.js 1:0-14 - harmony side effect evaluation isomorphic-fetch ./other-vendors.js 2:0-47 - harmony import specifier isomorphic-fetch ./other-vendors.js 5:20-35 - harmony side effect evaluation isomorphic-fetch ./page1.js 1:0-47 - harmony import specifier isomorphic-fetch ./page1.js 5:12-27 - ./node_modules/lodash.js 27 bytes [built] - harmony side effect evaluation lodash ./app.js 2:0-28 - harmony import specifier lodash ./app.js 4:29-35 - harmony side effect evaluation lodash ./lazy.js 1:0-28 - harmony import specifier lodash ./lazy.js 4:12-18 - cjs self exports reference ./node_modules/lodash.js 1:0-14 - harmony side effect evaluation lodash ./other-vendors.js 1:0-28 - harmony import specifier lodash ./other-vendors.js 5:12-18 - ./other-vendors.js 146 bytes [built] - [no exports] - [no exports used] - entry ./other-vendors other-vendors + > ./other-vendors other-vendors + dependent modules 64 bytes [dependent] 2 modules + ./other-vendors.js 146 bytes [built] [code generated] + [no exports] + [used exports unknown] + entry ./other-vendors other-vendors chunk page1.js (page1) 176 bytes <{app}> <{react-vendors}> <{runtime}> >{lazy_js}< [initial] [rendered] - > ./page1.js page1 - ./page1.js 176 bytes [built] - [no exports] - [no exports used] - entry ./page1.js page1 + > ./page1.js page1 + ./page1.js 176 bytes [built] [code generated] + [no exports] + [used exports unknown] + entry ./page1.js page1 chunk react-vendors.js (react-vendors) 87 bytes ={runtime}= >{page1}< [initial] [rendered] - > prop-types react-vendors - > react react-vendors - > react-dom react-vendors - ./node_modules/prop-types.js 31 bytes [built] - harmony side effect evaluation prop-types ./lazy.js 2:0-35 - harmony import specifier prop-types ./lazy.js 4:20-29 - cjs self exports reference ./node_modules/prop-types.js 1:0-14 - entry prop-types react-vendors - ./node_modules/react-dom.js 30 bytes [built] - cjs self exports reference ./node_modules/react-dom.js 1:0-14 - harmony side effect evaluation react-dom ./page1.js 3:0-33 - harmony import specifier react-dom ./page1.js 5:36-44 - entry react-dom react-vendors - ./node_modules/react.js 26 bytes [built] - cjs self exports reference ./node_modules/react.js 1:0-14 - harmony side effect evaluation react ./page1.js 2:0-26 - harmony import specifier react ./page1.js 5:29-34 - entry react react-vendors -chunk runtime.js (runtime) 6.18 KiB ={other-vendors}= ={react-vendors}= >{app}< >{page1}< [entry] [rendered] - > ./other-vendors other-vendors - > prop-types react-vendors - > react react-vendors - > react-dom react-vendors - 8 chunk modules + > prop-types react-vendors + > react react-vendors + > react-dom react-vendors + ./node_modules/prop-types.js 31 bytes [built] [code generated] + [used exports unknown] + harmony side effect evaluation prop-types ./lazy.js 2:0-35 + harmony import specifier prop-types ./lazy.js 4:20-29 + cjs self exports reference ./node_modules/prop-types.js 1:0-14 + entry prop-types react-vendors + ./node_modules/react-dom.js 30 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./node_modules/react-dom.js 1:0-14 + harmony side effect evaluation react-dom ./page1.js 3:0-33 + harmony import specifier react-dom ./page1.js 5:36-44 + entry react-dom react-vendors + ./node_modules/react.js 26 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./node_modules/react.js 1:0-14 + harmony side effect evaluation react ./page1.js 2:0-26 + harmony import specifier react ./page1.js 5:29-34 + entry react react-vendors +chunk runtime.js (runtime) 6.86 KiB ={other-vendors}= ={react-vendors}= >{app}< >{page1}< [entry] [rendered] + > ./other-vendors other-vendors + > prop-types react-vendors + > react react-vendors + > react-dom react-vendors + runtime modules 6.86 KiB 9 modules +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size - app.js 186 bytes [emitted] [name: app] - lazy_js.js 163 bytes [emitted] -other-vendors.js 245 bytes [emitted] [name: other-vendors] - page1.js 266 bytes [emitted] [name: page1] -react-vendors.js 210 bytes [emitted] [name: react-vendors] - runtime.js 1.94 KiB [emitted] [name: runtime] -Entrypoint app = app.js -Entrypoint page1 = page1.js -Entrypoint react-vendors = runtime.js react-vendors.js -Entrypoint other-vendors = runtime.js other-vendors.js -chunk app.js (app) 116 bytes <{other-vendors}> <{runtime}> >{page1}< [initial] [rendered] - > ./app.js app - ./app.js 116 bytes [built] - [no exports] - [no exports used] - entry ./app.js app -chunk lazy_js.js 98 bytes <{page1}> [rendered] - > ./lazy ./page1.js 7:0-16 - ./lazy.js 98 bytes [built] - [no exports] - import() ./lazy ./page1.js 7:0-16 -chunk other-vendors.js (other-vendors) 210 bytes ={runtime}= >{app}< [initial] [rendered] - > ./other-vendors other-vendors - ./node_modules/isomorphic-fetch.js 37 bytes [built] - harmony side effect evaluation isomorphic-fetch ./app.js 1:0-47 - harmony import specifier isomorphic-fetch ./app.js 4:12-27 - cjs self exports reference ./node_modules/isomorphic-fetch.js 1:0-14 - harmony side effect evaluation isomorphic-fetch ./other-vendors.js 2:0-47 - harmony import specifier isomorphic-fetch ./other-vendors.js 5:20-35 - harmony side effect evaluation isomorphic-fetch ./page1.js 1:0-47 - harmony import specifier isomorphic-fetch ./page1.js 5:12-27 - ./node_modules/lodash.js 27 bytes [built] - harmony side effect evaluation lodash ./app.js 2:0-28 - harmony import specifier lodash ./app.js 4:29-35 - harmony side effect evaluation lodash ./lazy.js 1:0-28 - harmony import specifier lodash ./lazy.js 4:12-18 - cjs self exports reference ./node_modules/lodash.js 1:0-14 - harmony side effect evaluation lodash ./other-vendors.js 1:0-28 - harmony import specifier lodash ./other-vendors.js 5:12-18 - ./other-vendors.js 146 bytes [built] - [no exports] - [no exports used] - entry ./other-vendors other-vendors -chunk page1.js (page1) 176 bytes <{app}> <{react-vendors}> <{runtime}> >{lazy_js}< [initial] [rendered] - > ./page1.js page1 - ./page1.js 176 bytes [built] - [no exports] - [no exports used] - entry ./page1.js page1 -chunk react-vendors.js (react-vendors) 87 bytes ={runtime}= >{page1}< [initial] [rendered] - > prop-types react-vendors - > react react-vendors - > react-dom react-vendors - ./node_modules/prop-types.js 31 bytes [built] - harmony side effect evaluation prop-types ./lazy.js 2:0-35 - harmony import specifier prop-types ./lazy.js 4:20-29 - cjs self exports reference ./node_modules/prop-types.js 1:0-14 - entry prop-types react-vendors - ./node_modules/react-dom.js 30 bytes [built] - cjs self exports reference ./node_modules/react-dom.js 1:0-14 - harmony side effect evaluation react-dom ./page1.js 3:0-33 - harmony import specifier react-dom ./page1.js 5:36-44 - entry react-dom react-vendors - ./node_modules/react.js 26 bytes [built] - cjs self exports reference ./node_modules/react.js 1:0-14 - harmony side effect evaluation react ./page1.js 2:0-26 - harmony import specifier react ./page1.js 5:29-34 - entry react react-vendors -chunk runtime.js (runtime) 6.18 KiB ={other-vendors}= ={react-vendors}= >{app}< >{page1}< [entry] [rendered] - > ./other-vendors other-vendors - > prop-types react-vendors - > react react-vendors - > react-dom react-vendors - 8 chunk modules +asset runtime.js 2.24 KiB [emitted] [minimized] (name: runtime) +asset page1.js 264 bytes [emitted] [minimized] (name: page1) +asset other-vendors.js 243 bytes [emitted] [minimized] (name: other-vendors) +asset react-vendors.js 208 bytes [emitted] [minimized] (name: react-vendors) +asset app.js 184 bytes [emitted] [minimized] (name: app) +asset lazy_js.js 159 bytes [emitted] [minimized] +Entrypoint app 184 bytes = app.js +Entrypoint page1 264 bytes = page1.js +Entrypoint react-vendors 2.45 KiB = runtime.js 2.24 KiB react-vendors.js 208 bytes +Entrypoint other-vendors 2.48 KiB = runtime.js 2.24 KiB other-vendors.js 243 bytes +chunk (runtime: runtime) app.js (app) 116 bytes <{other-vendors}> <{runtime}> >{page1}< [initial] [rendered] + > ./app.js app + ./app.js 116 bytes [built] [code generated] + [no exports] + [no exports used] + entry ./app.js app +chunk (runtime: runtime) lazy_js.js 98 bytes <{page1}> [rendered] + > ./lazy ./page1.js 7:0-16 + ./lazy.js 98 bytes [built] [code generated] + [no exports] + import() ./lazy ./page1.js 7:0-16 +chunk (runtime: runtime) other-vendors.js (other-vendors) 210 bytes ={runtime}= >{app}< [initial] [rendered] + > ./other-vendors other-vendors + dependent modules 64 bytes [dependent] 2 modules + ./other-vendors.js 146 bytes [built] [code generated] + [no exports] + [no exports used] + entry ./other-vendors other-vendors +chunk (runtime: runtime) page1.js (page1) 176 bytes <{app}> <{react-vendors}> <{runtime}> >{lazy_js}< [initial] [rendered] + > ./page1.js page1 + ./page1.js 176 bytes [built] [code generated] + [no exports] + [no exports used] + entry ./page1.js page1 +chunk (runtime: runtime) react-vendors.js (react-vendors) 87 bytes ={runtime}= >{page1}< [initial] [rendered] + > prop-types react-vendors + > react react-vendors + > react-dom react-vendors + ./node_modules/prop-types.js 31 bytes [built] [code generated] + [used exports unknown] + harmony side effect evaluation prop-types ./lazy.js 2:0-35 + harmony import specifier prop-types ./lazy.js 4:20-29 + cjs self exports reference ./node_modules/prop-types.js 1:0-14 + entry prop-types react-vendors + ./node_modules/react-dom.js 30 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./node_modules/react-dom.js 1:0-14 + harmony side effect evaluation react-dom ./page1.js 3:0-33 + harmony import specifier react-dom ./page1.js 5:36-44 + entry react-dom react-vendors + ./node_modules/react.js 26 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./node_modules/react.js 1:0-14 + harmony side effect evaluation react ./page1.js 2:0-26 + harmony import specifier react ./page1.js 5:29-34 + entry react react-vendors +chunk (runtime: runtime) runtime.js (runtime) 6.86 KiB ={other-vendors}= ={react-vendors}= >{app}< >{page1}< [entry] [rendered] + > ./other-vendors other-vendors + > prop-types react-vendors + > react react-vendors + > react-dom react-vendors + runtime modules 6.86 KiB 9 modules +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/code-splitting-depend-on-simple/README.md b/examples/code-splitting-depend-on-simple/README.md index 83cda735b..a8b05bd3d 100644 --- a/examples/code-splitting-depend-on-simple/README.md +++ b/examples/code-splitting-depend-on-simple/README.md @@ -31,18 +31,19 @@ console.log(react, reactDOM, propTypes); # dist/app.js ```javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["app"],{ +(self["webpackChunk"] = self["webpackChunk"] || []).push([["app"],{ /***/ 3: /*!****************!*\ !*** ./app.js ***! \****************/ /*! namespace exports */ -/*! exports [not provided] [unused] */ -/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.* */ -/***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => { +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; +__webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 0); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ 1); @@ -58,7 +59,8 @@ console.log((react__WEBPACK_IMPORTED_MODULE_0___default()), (react_dom__WEBPACK_ /***/ }) -},[[3,"react-vendors"]]]); +}, +0,[[3,"react-vendors"]]]); ``` # dist/react-vendors.js @@ -71,8 +73,8 @@ console.log((react__WEBPACK_IMPORTED_MODULE_0___default()), (react_dom__WEBPACK_ !*** ./node_modules/react.js ***! \*******************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = 'react'; @@ -84,8 +86,8 @@ module.exports = 'react'; !*** ./node_modules/react-dom.js ***! \***********************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = 'react-dom'; @@ -97,8 +99,8 @@ module.exports = 'react-dom'; !*** ./node_modules/prop-types.js ***! \************************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = 'prop-types'; @@ -168,8 +170,21 @@ module.exports = 'prop-types'; /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) /******/ })(); /******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -222,17 +237,14 @@ module.exports = 'prop-types'; /******/ __webpack_require__.x = () => { /******/ /******/ } -/******/ jsonpArray = jsonpArray.slice(); -/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); +/******/ chunkLoadingGlobal = chunkLoadingGlobal.slice(); +/******/ for(var i = 0; i < chunkLoadingGlobal.length; i++) webpackJsonpCallback(chunkLoadingGlobal[i]); /******/ return (checkDeferredModules = checkDeferredModulesImpl)(); /******/ }; /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ var executeModules = data[2]; -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime, executeModules] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -249,7 +261,7 @@ module.exports = 'prop-types'; /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } @@ -259,12 +271,11 @@ module.exports = 'prop-types'; /******/ /******/ // run deferred modules when all chunks ready /******/ return checkDeferredModules(); -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -284,75 +295,75 @@ module.exports = 'prop-types'; ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size - app.js 1.35 KiB [emitted] [name: app] -react-vendors.js 7.12 KiB [emitted] [name: react-vendors] -Entrypoint app = app.js -Entrypoint react-vendors = react-vendors.js +asset react-vendors.js 7.48 KiB [emitted] (name: react-vendors) +asset app.js 1.43 KiB [emitted] (name: app) chunk app.js (app) 139 bytes <{react-vendors}> [initial] [rendered] - > ./app.js app - ./app.js 139 bytes [built] - [no exports] - [no exports used] - entry ./app.js app -chunk react-vendors.js (react-vendors) 87 bytes (javascript) 3.17 KiB (runtime) >{app}< [entry] [rendered] - > prop-types react-vendors - > react react-vendors - > react-dom react-vendors - ./node_modules/prop-types.js 31 bytes [built] - harmony side effect evaluation prop-types ./app.js 3:0-35 - harmony import specifier prop-types ./app.js 5:29-38 - cjs self exports reference ./node_modules/prop-types.js 1:0-14 - entry prop-types react-vendors - ./node_modules/react-dom.js 30 bytes [built] - harmony side effect evaluation react-dom ./app.js 2:0-33 - harmony import specifier react-dom ./app.js 5:19-27 - cjs self exports reference ./node_modules/react-dom.js 1:0-14 - entry react-dom react-vendors - ./node_modules/react.js 26 bytes [built] - harmony side effect evaluation react ./app.js 1:0-26 - harmony import specifier react ./app.js 5:12-17 - cjs self exports reference ./node_modules/react.js 1:0-14 - entry react react-vendors - + 4 hidden chunk modules + > ./app.js app + ./app.js 139 bytes [built] [code generated] + [no exports] + [used exports unknown] + entry ./app.js app +chunk react-vendors.js (react-vendors) 87 bytes (javascript) 3.42 KiB (runtime) >{app}< [entry] [rendered] + > prop-types react-vendors + > react react-vendors + > react-dom react-vendors + runtime modules 3.42 KiB 5 modules + cacheable modules 87 bytes + ./node_modules/prop-types.js 31 bytes [built] [code generated] + [used exports unknown] + harmony side effect evaluation prop-types ./app.js 3:0-35 + harmony import specifier prop-types ./app.js 5:29-38 + cjs self exports reference ./node_modules/prop-types.js 1:0-14 + entry prop-types react-vendors + ./node_modules/react-dom.js 30 bytes [built] [code generated] + [used exports unknown] + harmony side effect evaluation react-dom ./app.js 2:0-33 + harmony import specifier react-dom ./app.js 5:19-27 + cjs self exports reference ./node_modules/react-dom.js 1:0-14 + entry react-dom react-vendors + ./node_modules/react.js 26 bytes [built] [code generated] + [used exports unknown] + harmony side effect evaluation react ./app.js 1:0-26 + harmony import specifier react ./app.js 5:12-17 + cjs self exports reference ./node_modules/react.js 1:0-14 + entry react react-vendors +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size - app.js 197 bytes [emitted] [name: app] -react-vendors.js 1.08 KiB [emitted] [name: react-vendors] -Entrypoint app = app.js -Entrypoint react-vendors = react-vendors.js -chunk app.js (app) 139 bytes <{react-vendors}> [initial] [rendered] - > ./app.js app - ./app.js 139 bytes [built] - [no exports] - [no exports used] - entry ./app.js app -chunk react-vendors.js (react-vendors) 87 bytes (javascript) 3.18 KiB (runtime) >{app}< [entry] [rendered] - > prop-types react-vendors - > react react-vendors - > react-dom react-vendors - ./node_modules/prop-types.js 31 bytes [built] - harmony side effect evaluation prop-types ./app.js 3:0-35 - harmony import specifier prop-types ./app.js 5:29-38 - cjs self exports reference ./node_modules/prop-types.js 1:0-14 - entry prop-types react-vendors - ./node_modules/react-dom.js 30 bytes [built] - harmony side effect evaluation react-dom ./app.js 2:0-33 - harmony import specifier react-dom ./app.js 5:19-27 - cjs self exports reference ./node_modules/react-dom.js 1:0-14 - entry react-dom react-vendors - ./node_modules/react.js 26 bytes [built] - harmony side effect evaluation react ./app.js 1:0-26 - harmony import specifier react ./app.js 5:12-17 - cjs self exports reference ./node_modules/react.js 1:0-14 - entry react react-vendors - + 4 hidden chunk modules +asset react-vendors.js 1.04 KiB [emitted] [minimized] (name: react-vendors) +asset app.js 195 bytes [emitted] [minimized] (name: app) +chunk (runtime: react-vendors) app.js (app) 139 bytes <{react-vendors}> [initial] [rendered] + > ./app.js app + ./app.js 139 bytes [built] [code generated] + [no exports] + [no exports used] + entry ./app.js app +chunk (runtime: react-vendors) react-vendors.js (react-vendors) 87 bytes (javascript) 3.16 KiB (runtime) >{app}< [entry] [rendered] + > prop-types react-vendors + > react react-vendors + > react-dom react-vendors + runtime modules 3.16 KiB 4 modules + cacheable modules 87 bytes + ./node_modules/prop-types.js 31 bytes [built] [code generated] + [used exports unknown] + harmony side effect evaluation prop-types ./app.js 3:0-35 + harmony import specifier prop-types ./app.js 5:29-38 + cjs self exports reference ./node_modules/prop-types.js 1:0-14 + entry prop-types react-vendors + ./node_modules/react-dom.js 30 bytes [built] [code generated] + [used exports unknown] + harmony side effect evaluation react-dom ./app.js 2:0-33 + harmony import specifier react-dom ./app.js 5:19-27 + cjs self exports reference ./node_modules/react-dom.js 1:0-14 + entry react-dom react-vendors + ./node_modules/react.js 26 bytes [built] [code generated] + [used exports unknown] + harmony side effect evaluation react ./app.js 1:0-26 + harmony import specifier react ./app.js 5:12-17 + cjs self exports reference ./node_modules/react.js 1:0-14 + entry react react-vendors +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/code-splitting-harmony/README.md b/examples/code-splitting-harmony/README.md index 5ec969ba0..112d919b3 100644 --- a/examples/code-splitting-harmony/README.md +++ b/examples/code-splitting-harmony/README.md @@ -29,13 +29,40 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) { ```javascript /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ([ -/* 0 */, +/* 0 */ +/*!********************!*\ + !*** ./example.js ***! + \********************/ +/*! namespace exports */ +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.e, __webpack_require__.t, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! a */ 1); +/* harmony import */ var a__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(a__WEBPACK_IMPORTED_MODULE_0__); + + +__webpack_require__.e(/*! import() */ 644).then(__webpack_require__.t.bind(__webpack_require__, /*! b */ 3, 7)).then(function(b) { + console.log("b loaded", b); +}) + +function loadC(name) { + return __webpack_require__(2)("./" + name); +} + +Promise.all([loadC("1"), loadC("2")]).then(function(arr) { + console.log("c/1 and c/2 loaded", arr); +}); + + +/***/ }), /* 1 */ /*!***************************!*\ !*** ./node_modules/a.js ***! \***************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [unused] */ /*! runtime requirements: */ /***/ (() => { @@ -43,11 +70,11 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) { /***/ }), /* 2 */ -/*!*******************************************************!*\ - !*** ./node_modules/c lazy ^\.\/.*$ namespace object ***! - \*******************************************************/ -/*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ +/*!********************************************************!*\ + !*** ./node_modules/c/ lazy ^\.\/.*$ namespace object ***! + \********************************************************/ +/*! default exports */ +/*! exports [not provided] [no usage info] */ /*! runtime requirements: module, __webpack_require__.o, __webpack_require__, __webpack_require__.e, __webpack_require__.t, __webpack_require__.* */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { @@ -196,6 +223,52 @@ module.exports = webpackAsyncContext; /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) /******/ })(); /******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName("script"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute("src") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute("nonce", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ if(prev) return prev(event); +/******/ } +/******/ ; +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports @@ -214,6 +287,8 @@ module.exports = webpackAsyncContext; /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -240,49 +315,24 @@ module.exports = webpackAsyncContext; /******/ /******/ // start chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); -/******/ var loadingEnded = () => { +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { /******/ if(__webpack_require__.o(installedChunks, chunkId)) { /******/ installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; -/******/ if(installedChunkData) return installedChunkData[1]; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } /******/ } /******/ }; -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = url; -/******/ -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ onScriptComplete = (event) => { -/******/ onScriptComplete = () => { -/******/ -/******/ } -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var reportError = loadingEnded(); -/******/ if(reportError) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ reportError(error); -/******/ } -/******/ } -/******/ ; -/******/ var timeout = setTimeout(() => { -/******/ onScriptComplete({ type: 'timeout', target: script }) -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -299,11 +349,8 @@ module.exports = webpackAsyncContext; /******/ // no deferred startup /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -320,17 +367,16 @@ module.exports = webpackAsyncContext; /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } /******/ -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -339,32 +385,10 @@ module.exports = webpackAsyncContext; ``` js -(() => { -"use strict"; -/*!********************!*\ - !*** ./example.js ***! - \********************/ -/*! namespace exports */ -/*! exports [not provided] [unused] */ -/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.e, __webpack_require__.t, __webpack_require__.* */ -/* harmony import */ var a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! a */ 1); -/* harmony import */ var a__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(a__WEBPACK_IMPORTED_MODULE_0__); - - -__webpack_require__.e(/*! import() */ 644).then(__webpack_require__.t.bind(__webpack_require__, /*! b */ 3, 7)).then(function(b) { - console.log("b loaded", b); -}) - -function loadC(name) { - return __webpack_require__(2)("./" + name); -} - -Promise.all([loadC("1"), loadC("2")]).then(function(arr) { - console.log("c/1 and c/2 loaded", arr); -}); - -})(); - +/******/ // startup +/******/ // Load entry module +/******/ __webpack_require__(0); +/******/ // This entry module used 'exports' so it can't be inlined /******/ })() ; ``` @@ -374,81 +398,73 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) { ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -346.output.js 381 bytes [emitted] -644.output.js 373 bytes [emitted] - 98.output.js 380 bytes [emitted] - output.js 12 KiB [emitted] [name: main] -Entrypoint main = output.js +asset output.js 13.1 KiB [emitted] (name: main) +asset 346.output.js 296 bytes [emitted] +asset 98.output.js 295 bytes [emitted] +asset 644.output.js 288 bytes [emitted] chunk 98.output.js 13 bytes [rendered] - > ./2 ./node_modules/c lazy ^\.\/.*$ namespace object ./2 - > ./2.js ./node_modules/c lazy ^\.\/.*$ namespace object ./2.js - ./node_modules/c/2.js 13 bytes [optional] [built] - context element ./2 ./node_modules/c lazy ^\.\/.*$ namespace object ./2 - context element ./2.js ./node_modules/c lazy ^\.\/.*$ namespace object ./2.js -chunk output.js (main) 414 bytes (javascript) 5.68 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 243 bytes [built] - [no exports] - [no exports used] - entry ./example.js main - ./node_modules/a.js 11 bytes [built] - [no exports used] - harmony side effect evaluation a ./example.js 1:0-18 - ./node_modules/c lazy ^\.\/.*$ namespace object 160 bytes [built] - import() context lazy c ./example.js 8:8-27 - + 9 hidden chunk modules + > ./2 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2 + > ./2.js ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2.js + ./node_modules/c/2.js 13 bytes [optional] [built] [code generated] + [used exports unknown] + context element ./2 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2 + context element ./2.js ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2.js +chunk output.js (main) 414 bytes (javascript) 6.34 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 6.34 KiB 10 modules + dependent modules 171 bytes [dependent] 2 modules + ./example.js 243 bytes [built] [code generated] + [no exports] + [used exports unknown] + entry ./example.js main chunk 346.output.js 13 bytes [rendered] - > ./1 ./node_modules/c lazy ^\.\/.*$ namespace object ./1 - > ./1.js ./node_modules/c lazy ^\.\/.*$ namespace object ./1.js - ./node_modules/c/1.js 13 bytes [optional] [built] - context element ./1 ./node_modules/c lazy ^\.\/.*$ namespace object ./1 - context element ./1.js ./node_modules/c lazy ^\.\/.*$ namespace object ./1.js + > ./1 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./1 + > ./1.js ./node_modules/c/ lazy ^\.\/.*$ namespace object ./1.js + ./node_modules/c/1.js 13 bytes [optional] [built] [code generated] + [used exports unknown] + context element ./1 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./1 + context element ./1.js ./node_modules/c/ lazy ^\.\/.*$ namespace object ./1.js chunk 644.output.js 11 bytes [rendered] - > b ./example.js 3:0-11 - ./node_modules/b.js 11 bytes [built] - import() b ./example.js 3:0-11 + > b ./example.js 3:0-11 + ./node_modules/b.js 11 bytes [built] [code generated] + [used exports unknown] + import() b ./example.js 3:0-11 +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -346.output.js 73 bytes [emitted] -644.output.js 73 bytes [emitted] - 98.output.js 71 bytes [emitted] - output.js 2.4 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk 98.output.js 13 bytes [rendered] - > ./2 ./node_modules/c lazy ^\.\/.*$ namespace object ./2 - > ./2.js ./node_modules/c lazy ^\.\/.*$ namespace object ./2.js - ./node_modules/c/2.js 13 bytes [optional] [built] - context element ./2 ./node_modules/c lazy ^\.\/.*$ namespace object ./2 - context element ./2.js ./node_modules/c lazy ^\.\/.*$ namespace object ./2.js -chunk output.js (main) 414 bytes (javascript) 5.68 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 243 bytes [built] - [no exports] - [no exports used] - entry ./example.js main - ./node_modules/a.js 11 bytes [built] - [no exports used] - harmony side effect evaluation a ./example.js 1:0-18 - ./node_modules/c lazy ^\.\/.*$ namespace object 160 bytes [built] - import() context lazy c ./example.js 8:8-27 - + 9 hidden chunk modules -chunk 346.output.js 13 bytes [rendered] - > ./1 ./node_modules/c lazy ^\.\/.*$ namespace object ./1 - > ./1.js ./node_modules/c lazy ^\.\/.*$ namespace object ./1.js - ./node_modules/c/1.js 13 bytes [optional] [built] - context element ./1 ./node_modules/c lazy ^\.\/.*$ namespace object ./1 - context element ./1.js ./node_modules/c lazy ^\.\/.*$ namespace object ./1.js -chunk 644.output.js 11 bytes [rendered] - > b ./example.js 3:0-11 - ./node_modules/b.js 11 bytes [built] - import() b ./example.js 3:0-11 +asset output.js 2.71 KiB [emitted] [minimized] (name: main) +asset 346.output.js 69 bytes [emitted] [minimized] +asset 644.output.js 69 bytes [emitted] [minimized] +asset 98.output.js 67 bytes [emitted] [minimized] +chunk (runtime: main) 98.output.js 13 bytes [rendered] + > ./2 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2 + > ./2.js ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2.js + ./node_modules/c/2.js 13 bytes [optional] [built] [code generated] + [used exports unknown] + context element ./2 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2 + context element ./2.js ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2.js +chunk (runtime: main) output.js (main) 414 bytes (javascript) 6.34 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 6.34 KiB 10 modules + dependent modules 171 bytes [dependent] 2 modules + ./example.js 243 bytes [built] [code generated] + [no exports] + [no exports used] + entry ./example.js main +chunk (runtime: main) 346.output.js 13 bytes [rendered] + > ./1 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./1 + > ./1.js ./node_modules/c/ lazy ^\.\/.*$ namespace object ./1.js + ./node_modules/c/1.js 13 bytes [optional] [built] [code generated] + [used exports unknown] + context element ./1 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./1 + context element ./1.js ./node_modules/c/ lazy ^\.\/.*$ namespace object ./1.js +chunk (runtime: main) 644.output.js 11 bytes [rendered] + > b ./example.js 3:0-11 + ./node_modules/b.js 11 bytes [built] [code generated] + [used exports unknown] + import() b ./example.js 3:0-11 +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/code-splitting-native-import-context-filter/README.md b/examples/code-splitting-native-import-context-filter/README.md index 0a23b55ed..298fadc3f 100644 --- a/examples/code-splitting-native-import-context-filter/README.md +++ b/examples/code-splitting-native-import-context-filter/README.md @@ -50,11 +50,11 @@ export default foo; /******/ var __webpack_modules__ = ([ /* 0 */, /* 1 */ -/*!******************************************************************************************!*\ - !*** ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ***! - \******************************************************************************************/ -/*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ +/*!*******************************************************************************************!*\ + !*** ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ***! + \*******************************************************************************************/ +/*! default exports */ +/*! exports [not provided] [no usage info] */ /*! runtime requirements: module, __webpack_require__.o, __webpack_require__, __webpack_require__.e, __webpack_require__.* */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { @@ -176,6 +176,52 @@ module.exports = webpackAsyncContext; /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) /******/ })(); /******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName("script"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute("src") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute("nonce", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ if(prev) return prev(event); +/******/ } +/******/ ; +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports @@ -194,6 +240,8 @@ module.exports = webpackAsyncContext; /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -220,49 +268,24 @@ module.exports = webpackAsyncContext; /******/ /******/ // start chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); -/******/ var loadingEnded = () => { +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { /******/ if(__webpack_require__.o(installedChunks, chunkId)) { /******/ installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; -/******/ if(installedChunkData) return installedChunkData[1]; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } /******/ } /******/ }; -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = url; -/******/ -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ onScriptComplete = (event) => { -/******/ onScriptComplete = () => { -/******/ -/******/ } -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var reportError = loadingEnded(); -/******/ if(reportError) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ reportError(error); -/******/ } -/******/ } -/******/ ; -/******/ var timeout = setTimeout(() => { -/******/ onScriptComplete({ type: 'timeout', target: script }) -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -279,11 +302,8 @@ module.exports = webpackAsyncContext; /******/ // no deferred startup /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -300,17 +320,16 @@ module.exports = webpackAsyncContext; /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } /******/ -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -324,7 +343,6 @@ module.exports = webpackAsyncContext; !*** ./example.js ***! \********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [unused] */ /*! runtime requirements: __webpack_require__ */ async function getTemplate(templateName) { try { @@ -355,83 +373,78 @@ getTemplate("baz.noimport"); ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -398.output.js 877 bytes [emitted] -544.output.js 877 bytes [emitted] -718.output.js 877 bytes [emitted] - output.js 10.1 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 597 bytes (javascript) 4.76 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 437 bytes [built] - [no exports used] - entry ./example.js main - ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object 160 bytes [optional] [built] - import() context lazy ./templates ./example.js 3:23-7:3 - + 7 hidden chunk modules +asset output.js 10.9 KiB [emitted] (name: main) +asset 398.output.js 856 bytes [emitted] +asset 544.output.js 856 bytes [emitted] +asset 718.output.js 856 bytes [emitted] +chunk output.js (main) 597 bytes (javascript) 5.42 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 5.42 KiB 8 modules + dependent modules 160 bytes [dependent] 1 module + ./example.js 437 bytes [built] [code generated] + [used exports unknown] + entry ./example.js main chunk 398.output.js 38 bytes [rendered] - > ./bar ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar - > ./bar.js ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js - ./templates/bar.js 38 bytes [optional] [built] - [exports: default] - context element ./bar ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar - context element ./bar.js ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js + > ./bar ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar + > ./bar.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js + ./templates/bar.js 38 bytes [optional] [built] [code generated] + [exports: default] + [used exports unknown] + context element ./bar ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar + context element ./bar.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js chunk 544.output.js 38 bytes [rendered] - > ./baz ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz - > ./baz.js ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js - ./templates/baz.js 38 bytes [optional] [built] - [exports: default] - context element ./baz ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz - context element ./baz.js ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js + > ./baz ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz + > ./baz.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js + ./templates/baz.js 38 bytes [optional] [built] [code generated] + [exports: default] + [used exports unknown] + context element ./baz ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz + context element ./baz.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js chunk 718.output.js 38 bytes [rendered] - > ./foo ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo - > ./foo.js ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js - ./templates/foo.js 38 bytes [optional] [built] - [exports: default] - context element ./foo ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo - context element ./foo.js ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js + > ./foo ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo + > ./foo.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js + ./templates/foo.js 38 bytes [optional] [built] [code generated] + [exports: default] + [used exports unknown] + context element ./foo ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo + context element ./foo.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -398.output.js 134 bytes [emitted] -544.output.js 134 bytes [emitted] -718.output.js 134 bytes [emitted] - output.js 2.1 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 597 bytes (javascript) 4.76 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 437 bytes [built] - [no exports used] - entry ./example.js main - ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object 160 bytes [optional] [built] - import() context lazy ./templates ./example.js 3:23-7:3 - + 7 hidden chunk modules -chunk 398.output.js 38 bytes [rendered] - > ./bar ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar - > ./bar.js ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js - ./templates/bar.js 38 bytes [optional] [built] - [exports: default] - context element ./bar ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar - context element ./bar.js ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js -chunk 544.output.js 38 bytes [rendered] - > ./baz ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz - > ./baz.js ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js - ./templates/baz.js 38 bytes [optional] [built] - [exports: default] - context element ./baz ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz - context element ./baz.js ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js -chunk 718.output.js 38 bytes [rendered] - > ./foo ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo - > ./foo.js ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js - ./templates/foo.js 38 bytes [optional] [built] - [exports: default] - context element ./foo ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo - context element ./foo.js ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js +asset output.js 2.41 KiB [emitted] [minimized] (name: main) +asset 398.output.js 130 bytes [emitted] [minimized] +asset 544.output.js 130 bytes [emitted] [minimized] +asset 718.output.js 130 bytes [emitted] [minimized] +chunk (runtime: main) output.js (main) 597 bytes (javascript) 5.42 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 5.42 KiB 8 modules + dependent modules 160 bytes [dependent] 1 module + ./example.js 437 bytes [built] [code generated] + [no exports used] + entry ./example.js main +chunk (runtime: main) 398.output.js 38 bytes [rendered] + > ./bar ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar + > ./bar.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js + ./templates/bar.js 38 bytes [optional] [built] [code generated] + [exports: default] + context element ./bar ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar + context element ./bar.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar.js +chunk (runtime: main) 544.output.js 38 bytes [rendered] + > ./baz ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz + > ./baz.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js + ./templates/baz.js 38 bytes [optional] [built] [code generated] + [exports: default] + context element ./baz ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz + context element ./baz.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz.js +chunk (runtime: main) 718.output.js 38 bytes [rendered] + > ./foo ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo + > ./foo.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js + ./templates/foo.js 38 bytes [optional] [built] [code generated] + [exports: default] + context element ./foo ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo + context element ./foo.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/code-splitting-native-import-context/README.md b/examples/code-splitting-native-import-context/README.md index d19f5baf6..355cb9b5e 100644 --- a/examples/code-splitting-native-import-context/README.md +++ b/examples/code-splitting-native-import-context/README.md @@ -39,11 +39,11 @@ export default foo; /******/ var __webpack_modules__ = ([ /* 0 */, /* 1 */ -/*!**************************************************!*\ - !*** ./templates lazy ^\.\/.*$ namespace object ***! - \**************************************************/ -/*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ +/*!***************************************************!*\ + !*** ./templates/ lazy ^\.\/.*$ namespace object ***! + \***************************************************/ +/*! default exports */ +/*! exports [not provided] [no usage info] */ /*! runtime requirements: module, __webpack_require__.o, __webpack_require__, __webpack_require__.e, __webpack_require__.* */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { @@ -165,6 +165,52 @@ module.exports = webpackAsyncContext; /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) /******/ })(); /******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName("script"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute("src") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute("nonce", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ if(prev) return prev(event); +/******/ } +/******/ ; +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports @@ -183,6 +229,8 @@ module.exports = webpackAsyncContext; /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -209,49 +257,24 @@ module.exports = webpackAsyncContext; /******/ /******/ // start chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); -/******/ var loadingEnded = () => { +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { /******/ if(__webpack_require__.o(installedChunks, chunkId)) { /******/ installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; -/******/ if(installedChunkData) return installedChunkData[1]; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } /******/ } /******/ }; -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = url; -/******/ -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ onScriptComplete = (event) => { -/******/ onScriptComplete = () => { -/******/ -/******/ } -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var reportError = loadingEnded(); -/******/ if(reportError) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ reportError(error); -/******/ } -/******/ } -/******/ ; -/******/ var timeout = setTimeout(() => { -/******/ onScriptComplete({ type: 'timeout', target: script }) -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -268,11 +291,8 @@ module.exports = webpackAsyncContext; /******/ // no deferred startup /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -289,17 +309,16 @@ module.exports = webpackAsyncContext; /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } /******/ -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -313,7 +332,6 @@ module.exports = webpackAsyncContext; !*** ./example.js ***! \********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [unused] */ /*! runtime requirements: __webpack_require__ */ async function getTemplate(templateName) { try { @@ -342,83 +360,78 @@ getTemplate("baz"); ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -398.output.js 877 bytes [emitted] -544.output.js 877 bytes [emitted] -718.output.js 877 bytes [emitted] - output.js 9.95 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 441 bytes (javascript) 4.76 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 281 bytes [built] - [no exports used] - entry ./example.js main - ./templates lazy ^\.\/.*$ namespace object 160 bytes [optional] [built] - import() context lazy ./templates ./example.js 3:23-60 - + 7 hidden chunk modules +asset output.js 10.7 KiB [emitted] (name: main) +asset 398.output.js 856 bytes [emitted] +asset 544.output.js 856 bytes [emitted] +asset 718.output.js 856 bytes [emitted] +chunk output.js (main) 441 bytes (javascript) 5.42 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 5.42 KiB 8 modules + dependent modules 160 bytes [dependent] 1 module + ./example.js 281 bytes [built] [code generated] + [used exports unknown] + entry ./example.js main chunk 398.output.js 38 bytes [rendered] - > ./bar ./templates lazy ^\.\/.*$ namespace object ./bar - > ./bar.js ./templates lazy ^\.\/.*$ namespace object ./bar.js - ./templates/bar.js 38 bytes [optional] [built] - [exports: default] - context element ./bar ./templates lazy ^\.\/.*$ namespace object ./bar - context element ./bar.js ./templates lazy ^\.\/.*$ namespace object ./bar.js + > ./bar ./templates/ lazy ^\.\/.*$ namespace object ./bar + > ./bar.js ./templates/ lazy ^\.\/.*$ namespace object ./bar.js + ./templates/bar.js 38 bytes [optional] [built] [code generated] + [exports: default] + [used exports unknown] + context element ./bar ./templates/ lazy ^\.\/.*$ namespace object ./bar + context element ./bar.js ./templates/ lazy ^\.\/.*$ namespace object ./bar.js chunk 544.output.js 38 bytes [rendered] - > ./baz ./templates lazy ^\.\/.*$ namespace object ./baz - > ./baz.js ./templates lazy ^\.\/.*$ namespace object ./baz.js - ./templates/baz.js 38 bytes [optional] [built] - [exports: default] - context element ./baz ./templates lazy ^\.\/.*$ namespace object ./baz - context element ./baz.js ./templates lazy ^\.\/.*$ namespace object ./baz.js + > ./baz ./templates/ lazy ^\.\/.*$ namespace object ./baz + > ./baz.js ./templates/ lazy ^\.\/.*$ namespace object ./baz.js + ./templates/baz.js 38 bytes [optional] [built] [code generated] + [exports: default] + [used exports unknown] + context element ./baz ./templates/ lazy ^\.\/.*$ namespace object ./baz + context element ./baz.js ./templates/ lazy ^\.\/.*$ namespace object ./baz.js chunk 718.output.js 38 bytes [rendered] - > ./foo ./templates lazy ^\.\/.*$ namespace object ./foo - > ./foo.js ./templates lazy ^\.\/.*$ namespace object ./foo.js - ./templates/foo.js 38 bytes [optional] [built] - [exports: default] - context element ./foo ./templates lazy ^\.\/.*$ namespace object ./foo - context element ./foo.js ./templates lazy ^\.\/.*$ namespace object ./foo.js + > ./foo ./templates/ lazy ^\.\/.*$ namespace object ./foo + > ./foo.js ./templates/ lazy ^\.\/.*$ namespace object ./foo.js + ./templates/foo.js 38 bytes [optional] [built] [code generated] + [exports: default] + [used exports unknown] + context element ./foo ./templates/ lazy ^\.\/.*$ namespace object ./foo + context element ./foo.js ./templates/ lazy ^\.\/.*$ namespace object ./foo.js +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -398.output.js 134 bytes [emitted] -544.output.js 134 bytes [emitted] -718.output.js 134 bytes [emitted] - output.js 2.06 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 441 bytes (javascript) 4.76 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 281 bytes [built] - [no exports used] - entry ./example.js main - ./templates lazy ^\.\/.*$ namespace object 160 bytes [optional] [built] - import() context lazy ./templates ./example.js 3:23-60 - + 7 hidden chunk modules -chunk 398.output.js 38 bytes [rendered] - > ./bar ./templates lazy ^\.\/.*$ namespace object ./bar - > ./bar.js ./templates lazy ^\.\/.*$ namespace object ./bar.js - ./templates/bar.js 38 bytes [optional] [built] - [exports: default] - context element ./bar ./templates lazy ^\.\/.*$ namespace object ./bar - context element ./bar.js ./templates lazy ^\.\/.*$ namespace object ./bar.js -chunk 544.output.js 38 bytes [rendered] - > ./baz ./templates lazy ^\.\/.*$ namespace object ./baz - > ./baz.js ./templates lazy ^\.\/.*$ namespace object ./baz.js - ./templates/baz.js 38 bytes [optional] [built] - [exports: default] - context element ./baz ./templates lazy ^\.\/.*$ namespace object ./baz - context element ./baz.js ./templates lazy ^\.\/.*$ namespace object ./baz.js -chunk 718.output.js 38 bytes [rendered] - > ./foo ./templates lazy ^\.\/.*$ namespace object ./foo - > ./foo.js ./templates lazy ^\.\/.*$ namespace object ./foo.js - ./templates/foo.js 38 bytes [optional] [built] - [exports: default] - context element ./foo ./templates lazy ^\.\/.*$ namespace object ./foo - context element ./foo.js ./templates lazy ^\.\/.*$ namespace object ./foo.js +asset output.js 2.37 KiB [emitted] [minimized] (name: main) +asset 398.output.js 130 bytes [emitted] [minimized] +asset 544.output.js 130 bytes [emitted] [minimized] +asset 718.output.js 130 bytes [emitted] [minimized] +chunk (runtime: main) output.js (main) 441 bytes (javascript) 5.42 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 5.42 KiB 8 modules + dependent modules 160 bytes [dependent] 1 module + ./example.js 281 bytes [built] [code generated] + [no exports used] + entry ./example.js main +chunk (runtime: main) 398.output.js 38 bytes [rendered] + > ./bar ./templates/ lazy ^\.\/.*$ namespace object ./bar + > ./bar.js ./templates/ lazy ^\.\/.*$ namespace object ./bar.js + ./templates/bar.js 38 bytes [optional] [built] [code generated] + [exports: default] + context element ./bar ./templates/ lazy ^\.\/.*$ namespace object ./bar + context element ./bar.js ./templates/ lazy ^\.\/.*$ namespace object ./bar.js +chunk (runtime: main) 544.output.js 38 bytes [rendered] + > ./baz ./templates/ lazy ^\.\/.*$ namespace object ./baz + > ./baz.js ./templates/ lazy ^\.\/.*$ namespace object ./baz.js + ./templates/baz.js 38 bytes [optional] [built] [code generated] + [exports: default] + context element ./baz ./templates/ lazy ^\.\/.*$ namespace object ./baz + context element ./baz.js ./templates/ lazy ^\.\/.*$ namespace object ./baz.js +chunk (runtime: main) 718.output.js 38 bytes [rendered] + > ./foo ./templates/ lazy ^\.\/.*$ namespace object ./foo + > ./foo.js ./templates/ lazy ^\.\/.*$ namespace object ./foo.js + ./templates/foo.js 38 bytes [optional] [built] [code generated] + [exports: default] + context element ./foo ./templates/ lazy ^\.\/.*$ namespace object ./foo + context element ./foo.js ./templates/ lazy ^\.\/.*$ namespace object ./foo.js +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/code-splitting-specify-chunk-name/README.md b/examples/code-splitting-specify-chunk-name/README.md index 29e8a80fd..3b8d051c4 100644 --- a/examples/code-splitting-specify-chunk-name/README.md +++ b/examples/code-splitting-specify-chunk-name/README.md @@ -39,11 +39,11 @@ export default foo; /******/ var __webpack_modules__ = ([ /* 0 */, /* 1 */ -/*!*****************************************************************************!*\ - !*** ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ***! - \*****************************************************************************/ -/*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ +/*!******************************************************************************!*\ + !*** ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ***! + \******************************************************************************/ +/*! default exports */ +/*! exports [not provided] [no usage info] */ /*! runtime requirements: module, __webpack_require__.o, __webpack_require__, __webpack_require__.e, __webpack_require__.* */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { @@ -157,6 +157,52 @@ module.exports = webpackAsyncContext; /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) /******/ })(); /******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName("script"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute("src") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute("nonce", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ if(prev) return prev(event); +/******/ } +/******/ ; +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports @@ -175,6 +221,8 @@ module.exports = webpackAsyncContext; /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -201,49 +249,24 @@ module.exports = webpackAsyncContext; /******/ /******/ // start chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); -/******/ var loadingEnded = () => { +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { /******/ if(__webpack_require__.o(installedChunks, chunkId)) { /******/ installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; -/******/ if(installedChunkData) return installedChunkData[1]; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } /******/ } /******/ }; -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = url; -/******/ -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ onScriptComplete = (event) => { -/******/ onScriptComplete = () => { -/******/ -/******/ } -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var reportError = loadingEnded(); -/******/ if(reportError) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ reportError(error); -/******/ } -/******/ } -/******/ ; -/******/ var timeout = setTimeout(() => { -/******/ onScriptComplete({ type: 'timeout', target: script }) -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -260,11 +283,8 @@ module.exports = webpackAsyncContext; /******/ // no deferred startup /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -281,17 +301,16 @@ module.exports = webpackAsyncContext; /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } /******/ -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -305,7 +324,6 @@ module.exports = webpackAsyncContext; !*** ./example.js ***! \********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [unused] */ /*! runtime requirements: __webpack_require__, __webpack_require__.e, __webpack_require__.* */ __webpack_require__.e(/*! import() | chunk-foo */ 930).then(__webpack_require__.bind(__webpack_require__, /*! ./templates/foo */ 2)).then(function(foo) { console.log('foo:', foo); @@ -334,83 +352,78 @@ __webpack_require__(1)("./ba" + createContextVar).then(function(bar) { ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -548.output.js 877 bytes [emitted] [name: chunk-bar-baz2] -791.output.js 877 bytes [emitted] [name: chunk-bar-baz0] -930.output.js 877 bytes [emitted] [name: chunk-foo] - output.js 10.3 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 565 bytes (javascript) 4.76 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 405 bytes [built] - [no exports used] - entry ./example.js main - ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object 160 bytes [built] - import() context lazy ./templates ./example.js 11:0-84 - + 7 hidden chunk modules +asset output.js 11.1 KiB [emitted] (name: main) +asset 548.output.js 856 bytes [emitted] (name: chunk-bar-baz2) +asset 791.output.js 856 bytes [emitted] (name: chunk-bar-baz0) +asset 930.output.js 856 bytes [emitted] (name: chunk-foo) +chunk output.js (main) 565 bytes (javascript) 5.42 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 5.42 KiB 8 modules + dependent modules 160 bytes [dependent] 1 module + ./example.js 405 bytes [built] [code generated] + [used exports unknown] + entry ./example.js main chunk 548.output.js (chunk-bar-baz2) 38 bytes [rendered] - > ./baz ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz - > ./baz.js ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz.js - ./templates/baz.js 38 bytes [optional] [built] - [exports: default] - context element ./baz ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz - context element ./baz.js ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz.js + > ./baz ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz + > ./baz.js ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz.js + ./templates/baz.js 38 bytes [optional] [built] [code generated] + [exports: default] + [used exports unknown] + context element ./baz ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz + context element ./baz.js ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz.js chunk 791.output.js (chunk-bar-baz0) 38 bytes [rendered] - > ./bar ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar - > ./bar.js ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar.js - ./templates/bar.js 38 bytes [optional] [built] - [exports: default] - context element ./bar ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar - context element ./bar.js ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar.js + > ./bar ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar + > ./bar.js ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar.js + ./templates/bar.js 38 bytes [optional] [built] [code generated] + [exports: default] + [used exports unknown] + context element ./bar ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar + context element ./bar.js ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar.js chunk 930.output.js (chunk-foo) 38 bytes [rendered] - > ./templates/foo ./example.js 1:0-62 - > ./example.js 5:0-8:16 - ./templates/foo.js 38 bytes [built] - [exports: default] - import() ./templates/foo ./example.js 1:0-62 - cjs require ./templates/foo ./example.js 6:11-37 + > ./templates/foo ./example.js 1:0-62 + > ./example.js 5:0-8:16 + ./templates/foo.js 38 bytes [built] [code generated] + [exports: default] + [used exports unknown] + import() ./templates/foo ./example.js 1:0-62 + cjs require ./templates/foo ./example.js 6:11-37 +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -548.output.js 134 bytes [emitted] [name: chunk-bar-baz2] -791.output.js 134 bytes [emitted] [name: chunk-bar-baz0] -930.output.js 134 bytes [emitted] [name: chunk-foo] - output.js 2.08 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 565 bytes (javascript) 4.76 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 405 bytes [built] - [no exports used] - entry ./example.js main - ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object 160 bytes [built] - import() context lazy ./templates ./example.js 11:0-84 - + 7 hidden chunk modules -chunk 548.output.js (chunk-bar-baz2) 38 bytes [rendered] - > ./baz ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz - > ./baz.js ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz.js - ./templates/baz.js 38 bytes [optional] [built] - [exports: default] - context element ./baz ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz - context element ./baz.js ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz.js -chunk 791.output.js (chunk-bar-baz0) 38 bytes [rendered] - > ./bar ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar - > ./bar.js ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar.js - ./templates/bar.js 38 bytes [optional] [built] - [exports: default] - context element ./bar ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar - context element ./bar.js ./templates lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar.js -chunk 930.output.js (chunk-foo) 38 bytes [rendered] - > ./templates/foo ./example.js 1:0-62 - > ./example.js 5:0-8:16 - ./templates/foo.js 38 bytes [built] - [exports: default] - import() ./templates/foo ./example.js 1:0-62 - cjs require ./templates/foo ./example.js 6:11-37 +asset output.js 2.39 KiB [emitted] [minimized] (name: main) +asset 548.output.js 130 bytes [emitted] [minimized] (name: chunk-bar-baz2) +asset 791.output.js 130 bytes [emitted] [minimized] (name: chunk-bar-baz0) +asset 930.output.js 130 bytes [emitted] [minimized] (name: chunk-foo) +chunk (runtime: main) output.js (main) 565 bytes (javascript) 5.42 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 5.42 KiB 8 modules + dependent modules 160 bytes [dependent] 1 module + ./example.js 405 bytes [built] [code generated] + [no exports used] + entry ./example.js main +chunk (runtime: main) 548.output.js (chunk-bar-baz2) 38 bytes [rendered] + > ./baz ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz + > ./baz.js ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz.js + ./templates/baz.js 38 bytes [optional] [built] [code generated] + [exports: default] + context element ./baz ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz + context element ./baz.js ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz.js +chunk (runtime: main) 791.output.js (chunk-bar-baz0) 38 bytes [rendered] + > ./bar ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar + > ./bar.js ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar.js + ./templates/bar.js 38 bytes [optional] [built] [code generated] + [exports: default] + context element ./bar ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar + context element ./bar.js ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar.js +chunk (runtime: main) 930.output.js (chunk-foo) 38 bytes [rendered] + > ./templates/foo ./example.js 1:0-62 + > ./example.js 5:0-8:16 + ./templates/foo.js 38 bytes [built] [code generated] + [exports: default] + import() ./templates/foo ./example.js 1:0-62 + cjs require ./templates/foo ./example.js 6:11-37 +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/code-splitting/README.md b/examples/code-splitting/README.md index 59ccd67f8..ed744df4f 100644 --- a/examples/code-splitting/README.md +++ b/examples/code-splitting/README.md @@ -45,7 +45,6 @@ require.ensure(["c"], function(require) { !*** ./node_modules/a.js ***! \***************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: */ /***/ (() => { @@ -57,7 +56,6 @@ require.ensure(["c"], function(require) { !*** ./node_modules/b.js ***! \***************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: */ /***/ (() => { @@ -125,6 +123,52 @@ require.ensure(["c"], function(require) { /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) /******/ })(); /******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName("script"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute("src") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute("nonce", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ if(prev) return prev(event); +/******/ } +/******/ ; +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/publicPath */ /******/ (() => { /******/ __webpack_require__.p = "dist/"; @@ -132,6 +176,8 @@ require.ensure(["c"], function(require) { /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -158,49 +204,24 @@ require.ensure(["c"], function(require) { /******/ /******/ // start chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); -/******/ var loadingEnded = () => { +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { /******/ if(__webpack_require__.o(installedChunks, chunkId)) { /******/ installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; -/******/ if(installedChunkData) return installedChunkData[1]; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } /******/ } /******/ }; -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = url; -/******/ -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ onScriptComplete = (event) => { -/******/ onScriptComplete = () => { -/******/ -/******/ } -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var reportError = loadingEnded(); -/******/ if(reportError) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ reportError(error); -/******/ } -/******/ } -/******/ ; -/******/ var timeout = setTimeout(() => { -/******/ onScriptComplete({ type: 'timeout', target: script }) -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -217,11 +238,8 @@ require.ensure(["c"], function(require) { /******/ // no deferred startup /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -238,17 +256,16 @@ require.ensure(["c"], function(require) { /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } /******/ -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -262,7 +279,6 @@ require.ensure(["c"], function(require) { !*** ./example.js ***! \********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [unused] */ /*! runtime requirements: __webpack_require__, __webpack_require__.e, __webpack_require__.* */ var a = __webpack_require__(/*! a */ 1); var b = __webpack_require__(/*! b */ 2); @@ -279,7 +295,7 @@ __webpack_require__.e(/*! require.ensure */ 796).then((function(require) { # dist/796.output.js ```javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[796],[ +(self["webpackChunk"] = self["webpackChunk"] || []).push([[796],[ /* 0 */, /* 1 */, /* 2 */, @@ -288,7 +304,6 @@ __webpack_require__.e(/*! require.ensure */ 796).then((function(require) { !*** ./node_modules/c.js ***! \***************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: */ /***/ (() => { @@ -300,7 +315,6 @@ __webpack_require__.e(/*! require.ensure */ 796).then((function(require) { !*** ./node_modules/d.js ***! \***************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: */ /***/ (() => { @@ -313,7 +327,7 @@ __webpack_require__.e(/*! require.ensure */ 796).then((function(require) { Minimized ```javascript -(window.webpackJsonp=window.webpackJsonp||[]).push([[796],{286:()=>{},882:()=>{}}]); +(self.webpackChunk=self.webpackChunk||[]).push([[796],{286:()=>{},882:()=>{}}]); ``` # Info @@ -321,55 +335,45 @@ Minimized ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -796.output.js 694 bytes [emitted] - output.js 8.54 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 161 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 139 bytes [built] - [no exports used] - entry ./example.js main - ./node_modules/a.js 11 bytes [built] - cjs require a ./example.js 1:8-20 - ./node_modules/b.js 11 bytes [built] - cjs require b ./example.js 2:8-20 - cjs full require b ./example.js 4:4-20 - + 5 hidden chunk modules +asset output.js 9.23 KiB [emitted] (name: main) +asset 796.output.js 528 bytes [emitted] +chunk output.js (main) 161 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 4.85 KiB 6 modules + dependent modules 22 bytes [dependent] 2 modules + ./example.js 139 bytes [built] [code generated] + [used exports unknown] + entry ./example.js main chunk 796.output.js 22 bytes [rendered] - > ./example.js 3:0-6:2 - ./node_modules/c.js 11 bytes [built] - require.ensure item c ./example.js 3:0-6:2 - ./node_modules/d.js 11 bytes [built] - cjs require d ./example.js 5:12-24 + > ./example.js 3:0-6:2 + ./node_modules/c.js 11 bytes [built] [code generated] + [used exports unknown] + require.ensure item c ./example.js 3:0-6:2 + ./node_modules/d.js 11 bytes [built] [code generated] + [used exports unknown] + cjs require d ./example.js 5:12-24 +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -796.output.js 84 bytes [emitted] - output.js 1.38 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 161 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 139 bytes [built] - [no exports used] - entry ./example.js main - ./node_modules/a.js 11 bytes [built] - cjs require a ./example.js 1:8-20 - ./node_modules/b.js 11 bytes [built] - cjs require b ./example.js 2:8-20 - cjs full require b ./example.js 4:4-20 - + 5 hidden chunk modules -chunk 796.output.js 22 bytes [rendered] - > ./example.js 3:0-6:2 - ./node_modules/c.js 11 bytes [built] - require.ensure item c ./example.js 3:0-6:2 - ./node_modules/d.js 11 bytes [built] - cjs require d ./example.js 5:12-24 +asset output.js 1.68 KiB [emitted] [minimized] (name: main) +asset 796.output.js 80 bytes [emitted] [minimized] +chunk (runtime: main) output.js (main) 161 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 4.85 KiB 6 modules + dependent modules 22 bytes [dependent] 2 modules + ./example.js 139 bytes [built] [code generated] + [no exports used] + entry ./example.js main +chunk (runtime: main) 796.output.js 22 bytes [rendered] + > ./example.js 3:0-6:2 + ./node_modules/c.js 11 bytes [built] [code generated] + [used exports unknown] + require.ensure item c ./example.js 3:0-6:2 + ./node_modules/d.js 11 bytes [built] [code generated] + [used exports unknown] + cjs require d ./example.js 5:12-24 +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/coffee-script/README.md b/examples/coffee-script/README.md index 99656ddfa..6d55042e1 100644 --- a/examples/coffee-script/README.md +++ b/examples/coffee-script/README.md @@ -33,8 +33,8 @@ module.exports = 42 !*** ./cup1.coffee ***! \*********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module, __webpack_require__ */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = { @@ -51,8 +51,8 @@ module.exports = { !*** ./cup2.coffee ***! \*********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 3:0-14 */ /***/ ((module) => { console.log("yeah coffee-script"); @@ -102,7 +102,6 @@ module.exports = 42; !*** ./example.js ***! \********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [unused] */ /*! runtime requirements: __webpack_require__ */ console.log(__webpack_require__(/*! ./cup1 */ 1)); })(); @@ -116,43 +115,25 @@ console.log(__webpack_require__(/*! ./cup1 */ 1)); ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -output.js 2.18 KiB [emitted] [name: main] -Entrypoint main = output.js +asset output.js 2.09 KiB [emitted] (name: main) chunk output.js (main) 206 bytes [entry] [rendered] - > ./example.js main - ./cup1.coffee 118 bytes [built] - cjs require ./cup1 ./example.js 1:12-29 - cjs self exports reference ./cup1.coffee 1:0-14 - ./cup2.coffee 57 bytes [built] - cjs require ./cup2.coffee ./cup1.coffee 4:12-36 - cjs require ./cup2 ./cup1.coffee 5:9-26 - cjs self exports reference ./cup2.coffee 3:0-14 - ./example.js 31 bytes [built] - [no exports used] - entry ./example.js main + > ./example.js main + dependent modules 175 bytes [dependent] 2 modules + ./example.js 31 bytes [built] [code generated] + [used exports unknown] + entry ./example.js main +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -output.js 278 bytes [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 206 bytes [entry] [rendered] - > ./example.js main - ./cup1.coffee 118 bytes [built] - cjs require ./cup1 ./example.js 1:12-29 - cjs self exports reference ./cup1.coffee 1:0-14 - ./cup2.coffee 57 bytes [built] - cjs require ./cup2.coffee ./cup1.coffee 4:12-36 - cjs require ./cup2 ./cup1.coffee 5:9-26 - cjs self exports reference ./cup2.coffee 3:0-14 - ./example.js 31 bytes [built] - [no exports used] - entry ./example.js main +asset output.js 280 bytes [emitted] [minimized] (name: main) +chunk (runtime: main) output.js (main) 206 bytes [entry] [rendered] + > ./example.js main + dependent modules 175 bytes [dependent] 2 modules + ./example.js 31 bytes [built] [code generated] + [no exports used] + entry ./example.js main +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/common-chunk-and-vendor-chunk/README.md b/examples/common-chunk-and-vendor-chunk/README.md index 73edfedb2..21da97b69 100644 --- a/examples/common-chunk-and-vendor-chunk/README.md +++ b/examples/common-chunk-and-vendor-chunk/README.md @@ -73,15 +73,15 @@ module.exports = { # dist/vendor.js ```javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["vendor"],{ +(self["webpackChunk"] = self["webpackChunk"] || []).push([["vendor"],{ /***/ 1: /*!*********************************!*\ !*** ./node_modules/vendor1.js ***! \*********************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = "vendor1"; @@ -93,8 +93,8 @@ module.exports = "vendor1"; !*** ./node_modules/vendor2.js ***! \*********************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = "vendor2"; @@ -107,15 +107,15 @@ module.exports = "vendor2"; # dist/commons-utility2_js.js ``` javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["commons-utility2_js"],{ +(self["webpackChunk"] = self["webpackChunk"] || []).push([["commons-utility2_js"],{ /***/ 3: /*!*********************!*\ !*** ./utility2.js ***! \*********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = "utility2"; @@ -128,15 +128,15 @@ module.exports = "utility2"; # dist/commons-utility3_js.js ``` javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["commons-utility3_js"],{ +(self["webpackChunk"] = self["webpackChunk"] || []).push([["commons-utility3_js"],{ /***/ 6: /*!*********************!*\ !*** ./utility3.js ***! \*********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = "utility3"; @@ -156,8 +156,8 @@ module.exports = "utility3"; !*** ./pageA.js ***! \******************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module, __webpack_require__ */ +/*! CommonJS bailout: module.exports is used directly at 5:0-14 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var vendor1 = __webpack_require__(/*! vendor1 */ 1); @@ -174,8 +174,8 @@ module.exports = "pageA"; !*** ./utility1.js ***! \*********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = "utility1"; @@ -222,6 +222,8 @@ module.exports = "utility1"; /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -272,17 +274,14 @@ module.exports = "utility1"; /******/ __webpack_require__.x = () => { /******/ /******/ } -/******/ jsonpArray = jsonpArray.slice(); -/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); +/******/ chunkLoadingGlobal = chunkLoadingGlobal.slice(); +/******/ for(var i = 0; i < chunkLoadingGlobal.length; i++) webpackJsonpCallback(chunkLoadingGlobal[i]); /******/ return (checkDeferredModules = checkDeferredModulesImpl)(); /******/ }; /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ var executeModules = data[2]; -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime, executeModules] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -299,7 +298,7 @@ module.exports = "utility1"; /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } @@ -309,12 +308,11 @@ module.exports = "utility1"; /******/ /******/ // run deferred modules when all chunks ready /******/ return checkDeferredModules(); -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -340,8 +338,8 @@ module.exports = "utility1"; !*** ./pageB.js ***! \******************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module, __webpack_require__ */ +/*! CommonJS bailout: module.exports is used directly at 5:0-14 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var vendor2 = __webpack_require__(/*! vendor2 */ 5); @@ -394,6 +392,8 @@ module.exports = "pageB"; /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -444,17 +444,14 @@ module.exports = "pageB"; /******/ __webpack_require__.x = () => { /******/ /******/ } -/******/ jsonpArray = jsonpArray.slice(); -/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); +/******/ chunkLoadingGlobal = chunkLoadingGlobal.slice(); +/******/ for(var i = 0; i < chunkLoadingGlobal.length; i++) webpackJsonpCallback(chunkLoadingGlobal[i]); /******/ return (checkDeferredModules = checkDeferredModulesImpl)(); /******/ }; /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ var executeModules = data[2]; -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime, executeModules] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -471,7 +468,7 @@ module.exports = "pageB"; /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } @@ -481,12 +478,11 @@ module.exports = "pageB"; /******/ /******/ // run deferred modules when all chunks ready /******/ return checkDeferredModules(); -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -512,8 +508,8 @@ module.exports = "pageB"; !*** ./pageC.js ***! \******************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module, __webpack_require__ */ +/*! CommonJS bailout: module.exports is used directly at 4:0-14 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var utility2 = __webpack_require__(/*! ./utility2 */ 3); @@ -564,6 +560,8 @@ module.exports = "pageC"; /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -614,17 +612,14 @@ module.exports = "pageC"; /******/ __webpack_require__.x = () => { /******/ /******/ } -/******/ jsonpArray = jsonpArray.slice(); -/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); +/******/ chunkLoadingGlobal = chunkLoadingGlobal.slice(); +/******/ for(var i = 0; i < chunkLoadingGlobal.length; i++) webpackJsonpCallback(chunkLoadingGlobal[i]); /******/ return (checkDeferredModules = checkDeferredModulesImpl)(); /******/ }; /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ var executeModules = data[2]; -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime, executeModules] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -641,7 +636,7 @@ module.exports = "pageC"; /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } @@ -651,12 +646,11 @@ module.exports = "pageC"; /******/ /******/ // run deferred modules when all chunks ready /******/ return checkDeferredModules(); -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -676,125 +670,133 @@ module.exports = "pageC"; ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -commons-utility2_js.js 402 bytes [emitted] [id hint: commons] -commons-utility3_js.js 402 bytes [emitted] [id hint: commons] - pageA.js 5.99 KiB [emitted] [name: pageA] - pageB.js 5.71 KiB [emitted] [name: pageB] - pageC.js 5.64 KiB [emitted] [name: pageC] - vendor.js 769 bytes [emitted] [name: vendor] [id hint: vendor] -Entrypoint pageA = vendor.js commons-utility2_js.js pageA.js -Entrypoint pageB = vendor.js commons-utility2_js.js commons-utility3_js.js pageB.js -Entrypoint pageC = commons-utility2_js.js commons-utility3_js.js pageC.js +assets by chunk 768 bytes (id hint: commons) + asset commons-utility2_js.js 384 bytes [emitted] (id hint: commons) + asset commons-utility3_js.js 384 bytes [emitted] (id hint: commons) +asset pageA.js 5.92 KiB [emitted] (name: pageA) +asset pageB.js 5.65 KiB [emitted] (name: pageB) +asset pageC.js 5.59 KiB [emitted] (name: pageC) +asset vendor.js 737 bytes [emitted] (name: vendor) (id hint: vendor) +Entrypoint pageA 7.02 KiB = vendor.js 737 bytes commons-utility2_js.js 384 bytes pageA.js 5.92 KiB +Entrypoint pageB 7.12 KiB = vendor.js 737 bytes commons-utility2_js.js 384 bytes commons-utility3_js.js 384 bytes pageB.js 5.65 KiB +Entrypoint pageC 6.34 KiB = commons-utility2_js.js 384 bytes commons-utility3_js.js 384 bytes pageC.js 5.59 KiB chunk commons-utility2_js.js (id hint: commons) 28 bytes [initial] [rendered] split chunk (cache group: commons) - > ./pageA pageA - > ./pageB pageB - > ./pageC pageC - ./utility2.js 28 bytes [built] - cjs require ./utility2 ./pageA.js 3:15-36 - cjs require ./utility2 ./pageB.js 2:15-36 - cjs require ./utility2 ./pageC.js 1:15-36 - cjs self exports reference ./utility2.js 1:0-14 + > ./pageA pageA + > ./pageB pageB + > ./pageC pageC + ./utility2.js 28 bytes [built] [code generated] + [used exports unknown] + cjs require ./utility2 ./pageA.js 3:15-36 + cjs require ./utility2 ./pageB.js 2:15-36 + cjs require ./utility2 ./pageC.js 1:15-36 + cjs self exports reference ./utility2.js 1:0-14 chunk commons-utility3_js.js (id hint: commons) 28 bytes [initial] [rendered] split chunk (cache group: commons) - > ./pageB pageB - > ./pageC pageC - ./utility3.js 28 bytes [built] - cjs require ./utility3 ./pageB.js 3:15-36 - cjs require ./utility3 ./pageC.js 2:15-36 - cjs self exports reference ./utility3.js 1:0-14 -chunk pageA.js (pageA) 165 bytes (javascript) 2.63 KiB (runtime) [entry] [rendered] - > ./pageA pageA - ./pageA.js 137 bytes [built] - cjs self exports reference ./pageA.js 5:0-14 - entry ./pageA pageA - ./utility1.js 28 bytes [built] - cjs require ./utility1 ./pageA.js 2:15-36 - cjs self exports reference ./utility1.js 1:0-14 - + 2 hidden chunk modules -chunk pageB.js (pageB) 137 bytes (javascript) 2.65 KiB (runtime) [entry] [rendered] - > ./pageB pageB - ./pageB.js 137 bytes [built] - cjs self exports reference ./pageB.js 5:0-14 - entry ./pageB pageB - + 2 hidden chunk modules -chunk pageC.js (pageC) 102 bytes (javascript) 2.64 KiB (runtime) [entry] [rendered] - > ./pageC pageC - ./pageC.js 102 bytes [built] - cjs self exports reference ./pageC.js 4:0-14 - entry ./pageC pageC - + 2 hidden chunk modules + > ./pageB pageB + > ./pageC pageC + ./utility3.js 28 bytes [built] [code generated] + [used exports unknown] + cjs require ./utility3 ./pageB.js 3:15-36 + cjs require ./utility3 ./pageC.js 2:15-36 + cjs self exports reference ./utility3.js 1:0-14 +chunk pageA.js (pageA) 165 bytes (javascript) 2.61 KiB (runtime) [entry] [rendered] + > ./pageA pageA + runtime modules 2.61 KiB 2 modules + dependent modules 28 bytes [dependent] 1 module + ./pageA.js 137 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./pageA.js 5:0-14 + entry ./pageA pageA +chunk pageB.js (pageB) 137 bytes (javascript) 2.63 KiB (runtime) [entry] [rendered] + > ./pageB pageB + runtime modules 2.63 KiB 2 modules + ./pageB.js 137 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./pageB.js 5:0-14 + entry ./pageB pageB +chunk pageC.js (pageC) 102 bytes (javascript) 2.62 KiB (runtime) [entry] [rendered] + > ./pageC pageC + runtime modules 2.62 KiB 2 modules + ./pageC.js 102 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./pageC.js 4:0-14 + entry ./pageC pageC chunk vendor.js (vendor) (id hint: vendor) 54 bytes [initial] [rendered] split chunk (cache group: vendor) (name: vendor) - > ./pageA pageA - > ./pageB pageB - ./node_modules/vendor1.js 27 bytes [built] - cjs self exports reference ./node_modules/vendor1.js 1:0-14 - cjs require vendor1 ./pageA.js 1:14-32 - ./node_modules/vendor2.js 27 bytes [built] - cjs self exports reference ./node_modules/vendor2.js 1:0-14 - cjs require vendor2 ./pageB.js 1:14-32 + > ./pageA pageA + > ./pageB pageB + ./node_modules/vendor1.js 27 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./node_modules/vendor1.js 1:0-14 + cjs require vendor1 ./pageA.js 1:14-32 + ./node_modules/vendor2.js 27 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./node_modules/vendor2.js 1:0-14 + cjs require vendor2 ./pageB.js 1:14-32 +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -commons-utility2_js.js 110 bytes [emitted] [id hint: commons] -commons-utility3_js.js 110 bytes [emitted] [id hint: commons] - pageA.js 938 bytes [emitted] [name: pageA] - pageB.js 930 bytes [emitted] [name: pageB] - pageC.js 914 bytes [emitted] [name: pageC] - vendor.js 125 bytes [emitted] [name: vendor] [id hint: vendor] -Entrypoint pageA = vendor.js commons-utility2_js.js pageA.js -Entrypoint pageB = vendor.js commons-utility2_js.js commons-utility3_js.js pageB.js -Entrypoint pageC = commons-utility2_js.js commons-utility3_js.js pageC.js -chunk commons-utility2_js.js (id hint: commons) 28 bytes [initial] [rendered] split chunk (cache group: commons) - > ./pageA pageA - > ./pageB pageB - > ./pageC pageC - ./utility2.js 28 bytes [built] - cjs require ./utility2 ./pageA.js 3:15-36 - cjs require ./utility2 ./pageB.js 2:15-36 - cjs require ./utility2 ./pageC.js 1:15-36 - cjs self exports reference ./utility2.js 1:0-14 -chunk commons-utility3_js.js (id hint: commons) 28 bytes [initial] [rendered] split chunk (cache group: commons) - > ./pageB pageB - > ./pageC pageC - ./utility3.js 28 bytes [built] - cjs require ./utility3 ./pageB.js 3:15-36 - cjs require ./utility3 ./pageC.js 2:15-36 - cjs self exports reference ./utility3.js 1:0-14 -chunk pageA.js (pageA) 165 bytes (javascript) 2.63 KiB (runtime) [entry] [rendered] - > ./pageA pageA - ./pageA.js 137 bytes [built] - cjs self exports reference ./pageA.js 5:0-14 - entry ./pageA pageA - ./utility1.js 28 bytes [built] - cjs require ./utility1 ./pageA.js 2:15-36 - cjs self exports reference ./utility1.js 1:0-14 - + 2 hidden chunk modules -chunk pageB.js (pageB) 137 bytes (javascript) 2.65 KiB (runtime) [entry] [rendered] - > ./pageB pageB - ./pageB.js 137 bytes [built] - cjs self exports reference ./pageB.js 5:0-14 - entry ./pageB pageB - + 2 hidden chunk modules -chunk pageC.js (pageC) 102 bytes (javascript) 2.64 KiB (runtime) [entry] [rendered] - > ./pageC pageC - ./pageC.js 102 bytes [built] - cjs self exports reference ./pageC.js 4:0-14 - entry ./pageC pageC - + 2 hidden chunk modules -chunk vendor.js (vendor) (id hint: vendor) 54 bytes [initial] [rendered] split chunk (cache group: vendor) (name: vendor) - > ./pageA pageA - > ./pageB pageB - ./node_modules/vendor1.js 27 bytes [built] - cjs self exports reference ./node_modules/vendor1.js 1:0-14 - cjs require vendor1 ./pageA.js 1:14-32 - ./node_modules/vendor2.js 27 bytes [built] - cjs self exports reference ./node_modules/vendor2.js 1:0-14 - cjs require vendor2 ./pageB.js 1:14-32 +assets by chunk 212 bytes (id hint: commons) + asset commons-utility2_js.js 106 bytes [emitted] [minimized] (id hint: commons) + asset commons-utility3_js.js 106 bytes [emitted] [minimized] (id hint: commons) +asset pageA.js 900 bytes [emitted] [minimized] (name: pageA) +asset pageB.js 892 bytes [emitted] [minimized] (name: pageB) +asset pageC.js 876 bytes [emitted] [minimized] (name: pageC) +asset vendor.js 121 bytes [emitted] [minimized] (name: vendor) (id hint: vendor) +Entrypoint pageA 1.1 KiB = vendor.js 121 bytes commons-utility2_js.js 106 bytes pageA.js 900 bytes +Entrypoint pageB 1.2 KiB = vendor.js 121 bytes commons-utility2_js.js 106 bytes commons-utility3_js.js 106 bytes pageB.js 892 bytes +Entrypoint pageC 1.06 KiB = commons-utility2_js.js 106 bytes commons-utility3_js.js 106 bytes pageC.js 876 bytes +chunk (runtime: pageA, pageB, pageC) commons-utility2_js.js (id hint: commons) 28 bytes [initial] [rendered] split chunk (cache group: commons) + > ./pageA pageA + > ./pageB pageB + > ./pageC pageC + ./utility2.js 28 bytes [built] [code generated] + [used exports unknown] + cjs require ./utility2 ./pageA.js 3:15-36 + cjs require ./utility2 ./pageB.js 2:15-36 + cjs require ./utility2 ./pageC.js 1:15-36 + cjs self exports reference ./utility2.js 1:0-14 +chunk (runtime: pageB, pageC) commons-utility3_js.js (id hint: commons) 28 bytes [initial] [rendered] split chunk (cache group: commons) + > ./pageB pageB + > ./pageC pageC + ./utility3.js 28 bytes [built] [code generated] + [used exports unknown] + cjs require ./utility3 ./pageB.js 3:15-36 + cjs require ./utility3 ./pageC.js 2:15-36 + cjs self exports reference ./utility3.js 1:0-14 +chunk (runtime: pageA) pageA.js (pageA) 165 bytes (javascript) 2.61 KiB (runtime) [entry] [rendered] + > ./pageA pageA + runtime modules 2.61 KiB 2 modules + dependent modules 28 bytes [dependent] 1 module + ./pageA.js 137 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./pageA.js 5:0-14 + entry ./pageA pageA +chunk (runtime: pageB) pageB.js (pageB) 137 bytes (javascript) 2.63 KiB (runtime) [entry] [rendered] + > ./pageB pageB + runtime modules 2.63 KiB 2 modules + ./pageB.js 137 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./pageB.js 5:0-14 + entry ./pageB pageB +chunk (runtime: pageC) pageC.js (pageC) 102 bytes (javascript) 2.62 KiB (runtime) [entry] [rendered] + > ./pageC pageC + runtime modules 2.62 KiB 2 modules + ./pageC.js 102 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./pageC.js 4:0-14 + entry ./pageC pageC +chunk (runtime: pageA, pageB) vendor.js (vendor) (id hint: vendor) 54 bytes [initial] [rendered] split chunk (cache group: vendor) (name: vendor) + > ./pageA pageA + > ./pageB pageB + ./node_modules/vendor1.js 27 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./node_modules/vendor1.js 1:0-14 + cjs require vendor1 ./pageA.js 1:14-32 + ./node_modules/vendor2.js 27 bytes [built] [code generated] + [used exports unknown] + cjs self exports reference ./node_modules/vendor2.js 1:0-14 + cjs require vendor2 ./pageB.js 1:14-32 +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/common-chunk-grandchildren/README.md b/examples/common-chunk-grandchildren/README.md index 3264f8b85..57a8b277a 100644 --- a/examples/common-chunk-grandchildren/README.md +++ b/examples/common-chunk-grandchildren/README.md @@ -168,6 +168,52 @@ module.exports = { /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) /******/ })(); /******/ +/******/ /* webpack/runtime/load script */ +/******/ (() => { +/******/ var inProgress = {}; +/******/ // data-webpack is not used as build has no uniqueName +/******/ // loadScript function to load a script via script tag +/******/ __webpack_require__.l = (url, done, key) => { +/******/ if(inProgress[url]) { inProgress[url].push(done); return; } +/******/ var script, needAttach; +/******/ if(key !== undefined) { +/******/ var scripts = document.getElementsByTagName("script"); +/******/ for(var i = 0; i < scripts.length; i++) { +/******/ var s = scripts[i]; +/******/ if(s.getAttribute("src") == url) { script = s; break; } +/******/ } +/******/ } +/******/ if(!script) { +/******/ needAttach = true; +/******/ script = document.createElement('script'); +/******/ +/******/ script.charset = 'utf-8'; +/******/ script.timeout = 120; +/******/ if (__webpack_require__.nc) { +/******/ script.setAttribute("nonce", __webpack_require__.nc); +/******/ } +/******/ +/******/ script.src = url; +/******/ } +/******/ inProgress[url] = [done]; +/******/ var onScriptComplete = (prev, event) => { +/******/ // avoid mem leaks in IE. +/******/ script.onerror = script.onload = null; +/******/ clearTimeout(timeout); +/******/ var doneFns = inProgress[url]; +/******/ delete inProgress[url]; +/******/ script.parentNode && script.parentNode.removeChild(script); +/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ if(prev) return prev(event); +/******/ } +/******/ ; +/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); +/******/ script.onerror = onScriptComplete.bind(null, script.onerror); +/******/ script.onload = onScriptComplete.bind(null, script.onload); +/******/ needAttach && document.head.appendChild(script); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/publicPath */ /******/ (() => { /******/ __webpack_require__.p = "dist/"; @@ -175,6 +221,8 @@ module.exports = { /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { +/******/ // no baseURI +/******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded @@ -201,49 +249,24 @@ module.exports = { /******/ /******/ // start chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); -/******/ var loadingEnded = () => { +/******/ // create error before stack unwound to get useful stacktrace later +/******/ var error = new Error(); +/******/ var loadingEnded = (event) => { /******/ if(__webpack_require__.o(installedChunks, chunkId)) { /******/ installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; -/******/ if(installedChunkData) return installedChunkData[1]; +/******/ if(installedChunkData) { +/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); +/******/ var realSrc = event && event.target && event.target.src; +/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; +/******/ error.name = 'ChunkLoadError'; +/******/ error.type = errorType; +/******/ error.request = realSrc; +/******/ installedChunkData[1](error); +/******/ } /******/ } /******/ }; -/******/ var script = document.createElement('script'); -/******/ var onScriptComplete; -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.src = url; -/******/ -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ onScriptComplete = (event) => { -/******/ onScriptComplete = () => { -/******/ -/******/ } -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var reportError = loadingEnded(); -/******/ if(reportError) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ reportError(error); -/******/ } -/******/ } -/******/ ; -/******/ var timeout = setTimeout(() => { -/******/ onScriptComplete({ type: 'timeout', target: script }) -/******/ }, 120000); -/******/ script.onerror = script.onload = onScriptComplete; -/******/ document.head.appendChild(script); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -260,11 +283,8 @@ module.exports = { /******/ // no deferred startup /******/ /******/ // install a JSONP callback for chunk loading -/******/ function webpackJsonpCallback(data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ -/******/ var runtime = data[3]; +/******/ var webpackJsonpCallback = (data) => { +/******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; @@ -281,17 +301,16 @@ module.exports = { /******/ } /******/ } /******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ parentChunkLoadingFunction(data); /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } /******/ -/******/ }; +/******/ } /******/ -/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; -/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); -/******/ jsonpArray.push = webpackJsonpCallback; -/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; +/******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback; /******/ })(); /******/ /************************************************************************/ @@ -304,7 +323,6 @@ module.exports = { !*** ./example.js ***! \********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [unused] */ /*! runtime requirements: __webpack_require__, __webpack_require__.e, __webpack_require__.* */ var main = function() { console.log("Main class"); @@ -327,15 +345,15 @@ main(); # dist/366.output.js ```javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[366],[ +(self["webpackChunk"] = self["webpackChunk"] || []).push([[366],[ /* 0 */, /* 1 */ /*!******************!*\ !*** ./pageA.js ***! \******************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module, __webpack_require__ */ +/*! CommonJS bailout: module.exports is used directly at 3:0-14 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var reusableComponent = __webpack_require__(/*! ./reusableComponent */ 2); @@ -353,15 +371,15 @@ module.exports = function() { # dist/588.output.js ```javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[588],{ +(self["webpackChunk"] = self["webpackChunk"] || []).push([[588],{ /***/ 3: /*!******************!*\ !*** ./pageB.js ***! \******************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module, __webpack_require__, __webpack_require__.e, __webpack_require__.* */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = function() { @@ -381,15 +399,15 @@ module.exports = function() { # dist/145.output.js ```javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[145],{ +(self["webpackChunk"] = self["webpackChunk"] || []).push([[145],{ /***/ 4: /*!******************!*\ !*** ./pageC.js ***! \******************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module, __webpack_require__ */ +/*! CommonJS bailout: module.exports is used directly at 3:0-14 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var reusableComponent = __webpack_require__(/*! ./reusableComponent */ 2); @@ -408,15 +426,15 @@ module.exports = function() { # dist/421.output.js ```javascript -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[421],{ +(self["webpackChunk"] = self["webpackChunk"] || []).push([[421],{ /***/ 2: /*!******************************!*\ !*** ./reusableComponent.js ***! \******************************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: module */ +/*! CommonJS bailout: module.exports is used directly at 1:0-14 */ /***/ ((module) => { module.exports = function() { @@ -434,83 +452,85 @@ module.exports = function() { ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -145.output.js 570 bytes [emitted] -366.output.js 576 bytes [emitted] -421.output.js 452 bytes [emitted] -588.output.js 754 bytes [emitted] - output.js 8.11 KiB [emitted] [name: main] -Entrypoint main = output.js +asset output.js 8.95 KiB [emitted] (name: main) +asset 588.output.js 736 bytes [emitted] +asset 366.output.js 558 bytes [emitted] +asset 145.output.js 552 bytes [emitted] +asset 421.output.js 434 bytes [emitted] chunk 145.output.js 136 bytes [rendered] - > ./pageB.js 3:1-6:3 - ./pageC.js 136 bytes [built] - cjs require ./pageC ./pageB.js 4:15-33 - cjs self exports reference ./pageC.js 3:0-14 -chunk output.js (main) 220 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 220 bytes [built] - [no exports used] - entry ./example.js main - + 5 hidden chunk modules + > ./pageB.js 3:1-6:3 + ./pageC.js 136 bytes [built] [code generated] + [used exports unknown] + cjs require ./pageC ./pageB.js 4:15-33 + cjs self exports reference ./pageC.js 3:0-14 +chunk output.js (main) 220 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 4.85 KiB 6 modules + ./example.js 220 bytes [built] [code generated] + [used exports unknown] + entry ./example.js main chunk 366.output.js 136 bytes [rendered] - > ./example.js 3:1-6:3 - ./pageA.js 136 bytes [built] - cjs require ./pageA ./example.js 4:15-33 - cjs self exports reference ./pageA.js 3:0-14 + > ./example.js 3:1-6:3 + ./pageA.js 136 bytes [built] [code generated] + [used exports unknown] + cjs require ./pageA ./example.js 4:15-33 + cjs self exports reference ./pageA.js 3:0-14 chunk 421.output.js 69 bytes [rendered] split chunk (cache group: default) - > ./example.js 3:1-6:3 - > ./pageB.js 3:1-6:3 - ./reusableComponent.js 69 bytes [built] - cjs require ./reusableComponent ./pageA.js 1:24-54 - cjs require ./reusableComponent ./pageC.js 1:24-54 - cjs self exports reference ./reusableComponent.js 1:0-14 + > ./example.js 3:1-6:3 + > ./pageB.js 3:1-6:3 + ./reusableComponent.js 69 bytes [built] [code generated] + [used exports unknown] + cjs require ./reusableComponent ./pageA.js 1:24-54 + cjs require ./reusableComponent ./pageC.js 1:24-54 + cjs self exports reference ./reusableComponent.js 1:0-14 chunk 588.output.js 133 bytes [rendered] - > ./example.js 7:1-10:3 - ./pageB.js 133 bytes [built] - cjs require ./pageB ./example.js 8:15-33 - cjs self exports reference ./pageB.js 1:0-14 + > ./example.js 7:1-10:3 + ./pageB.js 133 bytes [built] [code generated] + [used exports unknown] + cjs require ./pageB ./example.js 8:15-33 + cjs self exports reference ./pageB.js 1:0-14 +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -145.output.js 138 bytes [emitted] -366.output.js 138 bytes [emitted] -421.output.js 127 bytes [emitted] -588.output.js 202 bytes [emitted] - output.js 1.42 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk 145.output.js 136 bytes [rendered] - > ./pageB.js 3:1-6:3 - ./pageC.js 136 bytes [built] - cjs require ./pageC ./pageB.js 4:15-33 - cjs self exports reference ./pageC.js 3:0-14 -chunk output.js (main) 220 bytes (javascript) 4.19 KiB (runtime) [entry] [rendered] - > ./example.js main - ./example.js 220 bytes [built] - [no exports used] - entry ./example.js main - + 5 hidden chunk modules -chunk 366.output.js 136 bytes [rendered] - > ./example.js 3:1-6:3 - ./pageA.js 136 bytes [built] - cjs require ./pageA ./example.js 4:15-33 - cjs self exports reference ./pageA.js 3:0-14 -chunk 421.output.js 69 bytes [rendered] split chunk (cache group: default) - > ./example.js 3:1-6:3 - > ./pageB.js 3:1-6:3 - ./reusableComponent.js 69 bytes [built] - cjs require ./reusableComponent ./pageA.js 1:24-54 - cjs require ./reusableComponent ./pageC.js 1:24-54 - cjs self exports reference ./reusableComponent.js 1:0-14 -chunk 588.output.js 133 bytes [rendered] - > ./example.js 7:1-10:3 - ./pageB.js 133 bytes [built] - cjs require ./pageB ./example.js 8:15-33 - cjs self exports reference ./pageB.js 1:0-14 +asset output.js 1.74 KiB [emitted] [minimized] (name: main) +asset 588.output.js 198 bytes [emitted] [minimized] +asset 145.output.js 134 bytes [emitted] [minimized] +asset 366.output.js 134 bytes [emitted] [minimized] +asset 421.output.js 123 bytes [emitted] [minimized] +chunk (runtime: main) 145.output.js 136 bytes [rendered] + > ./pageB.js 3:1-6:3 + ./pageC.js 136 bytes [built] [code generated] + [used exports unknown] + cjs require ./pageC ./pageB.js 4:15-33 + cjs self exports reference ./pageC.js 3:0-14 +chunk (runtime: main) output.js (main) 220 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + > ./example.js main + runtime modules 4.85 KiB 6 modules + ./example.js 220 bytes [built] [code generated] + [no exports used] + entry ./example.js main +chunk (runtime: main) 366.output.js 136 bytes [rendered] + > ./example.js 3:1-6:3 + ./pageA.js 136 bytes [built] [code generated] + [used exports unknown] + cjs require ./pageA ./example.js 4:15-33 + cjs self exports reference ./pageA.js 3:0-14 +chunk (runtime: main) 421.output.js 69 bytes [rendered] split chunk (cache group: default) + > ./example.js 3:1-6:3 + > ./pageB.js 3:1-6:3 + ./reusableComponent.js 69 bytes [built] [code generated] + [used exports unknown] + cjs require ./reusableComponent ./pageA.js 1:24-54 + cjs require ./reusableComponent ./pageC.js 1:24-54 + cjs self exports reference ./reusableComponent.js 1:0-14 +chunk (runtime: main) 588.output.js 133 bytes [rendered] + > ./example.js 7:1-10:3 + ./pageB.js 133 bytes [built] [code generated] + [used exports unknown] + cjs require ./pageB ./example.js 8:15-33 + cjs self exports reference ./pageB.js 1:0-14 +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/commonjs/README.md b/examples/commonjs/README.md index 876fe81c8..87626689a 100644 --- a/examples/commonjs/README.md +++ b/examples/commonjs/README.md @@ -46,8 +46,8 @@ exports.add = function() { !*** ./increment.js ***! \**********************/ /*! default exports */ -/*! export increment [provided] [used] [could be renamed] */ -/*! other exports [not provided] [unused] */ +/*! export increment [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__, __webpack_exports__ */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { @@ -63,8 +63,8 @@ exports.increment = function(val) { !*** ./math.js ***! \*****************/ /*! default exports */ -/*! export add [provided] [used] [could be renamed] */ -/*! other exports [not provided] [unused] */ +/*! export add [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_exports__ */ /***/ ((__unused_webpack_module, exports) => { @@ -118,7 +118,6 @@ exports.add = function() { !*** ./example.js ***! \********************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [unused] */ /*! runtime requirements: __webpack_require__ */ const inc = __webpack_require__(/*! ./increment */ 1).increment; const a = 1; @@ -135,45 +134,25 @@ inc(a); // 2 ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -output.js 2.33 KiB [emitted] [name: main] -Entrypoint main = output.js +asset output.js 2.34 KiB [emitted] (name: main) chunk output.js (main) 326 bytes [entry] [rendered] - > ./example.js main - ./example.js 72 bytes [built] - [no exports used] - entry ./example.js main - ./increment.js 98 bytes [built] - [exports: increment] - [all exports used] - cjs full require ./increment ./example.js 1:12-44 - ./math.js 156 bytes [built] - [exports: add] - [all exports used] - cjs full require ./math ./increment.js 1:12-33 + > ./example.js main + dependent modules 254 bytes [dependent] 2 modules + ./example.js 72 bytes [built] [code generated] + [used exports unknown] + entry ./example.js main +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -output.js 297 bytes [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 326 bytes [entry] [rendered] - > ./example.js main - ./example.js 72 bytes [built] - [no exports used] - entry ./example.js main - ./increment.js 98 bytes [built] - [exports: increment] - [all exports used] - cjs full require ./increment ./example.js 1:12-44 - ./math.js 156 bytes [built] - [exports: add] - [all exports used] - cjs full require ./math ./increment.js 1:12-33 +asset output.js 296 bytes [emitted] [minimized] (name: main) +chunk (runtime: main) output.js (main) 326 bytes [entry] [rendered] + > ./example.js main + dependent modules 254 bytes [dependent] 2 modules + ./example.js 72 bytes [built] [code generated] + [no exports used] + entry ./example.js main +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/custom-json-modules/README.md b/examples/custom-json-modules/README.md index 3328a973c..50fb72135 100644 --- a/examples/custom-json-modules/README.md +++ b/examples/custom-json-modules/README.md @@ -101,21 +101,47 @@ module.exports = { /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ([ -/* 0 */, +/* 0 */ +/*!********************!*\ + !*** ./example.js ***! + \********************/ +/*! namespace exports */ +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _data_toml__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./data.toml */ 1); +/* harmony import */ var _data_yaml__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./data.yaml */ 2); +/* harmony import */ var _data_json5__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./data.json5 */ 3); + + + + +document.querySelector('#app').innerHTML = [_data_toml__WEBPACK_IMPORTED_MODULE_0__, _data_yaml__WEBPACK_IMPORTED_MODULE_1__, _data_json5__WEBPACK_IMPORTED_MODULE_2__].map(data => ` +

${data.title}

+
${data.owner.name}
+
${data.owner.organization}
+
${data.owner.bio}
+
${data.owner.dob}
+`).join('

'); + + +/***/ }), /* 1 */ /*!*******************!*\ !*** ./data.toml ***! \*******************/ /*! default exports */ -/*! export owner [provided] [maybe used (runtime-defined)] [usage prevents renaming] */ -/*! export bio [provided] [unused] [could be renamed] */ -/*! export dob [provided] [unused] [could be renamed] */ -/*! exports [not provided] [unused] */ -/*! export name [provided] [unused] [could be renamed] */ -/*! export organization [provided] [unused] [could be renamed] */ -/*! other exports [not provided] [unused] */ -/*! export title [provided] [maybe used (runtime-defined)] [usage prevents renaming] */ -/*! other exports [not provided] [maybe used (runtime-defined)] */ +/*! export owner [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export bio [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export dob [provided] [no usage info] [missing usage info prevents renaming] */ +/*! exports [not provided] [no usage info] */ +/*! export name [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export organization [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! export title [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ /*! runtime requirements: module */ /***/ ((module) => { @@ -127,15 +153,15 @@ module.exports = JSON.parse("{\"title\":\"TOML Example\",\"owner\":{\"name\":\"T !*** ./data.yaml ***! \*******************/ /*! default exports */ -/*! export owner [provided] [maybe used (runtime-defined)] [usage prevents renaming] */ -/*! export bio [provided] [unused] [could be renamed] */ -/*! export dob [provided] [unused] [could be renamed] */ -/*! exports [not provided] [unused] */ -/*! export name [provided] [unused] [could be renamed] */ -/*! export organization [provided] [unused] [could be renamed] */ -/*! other exports [not provided] [unused] */ -/*! export title [provided] [maybe used (runtime-defined)] [usage prevents renaming] */ -/*! other exports [not provided] [maybe used (runtime-defined)] */ +/*! export owner [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export bio [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export dob [provided] [no usage info] [missing usage info prevents renaming] */ +/*! exports [not provided] [no usage info] */ +/*! export name [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export organization [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! export title [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ /*! runtime requirements: module */ /***/ ((module) => { @@ -147,14 +173,14 @@ module.exports = JSON.parse("{\"title\":\"YAML Example\",\"owner\":{\"name\":\"T !*** ./data.json5 ***! \********************/ /*! default exports */ -/*! export owner [provided] [maybe used (runtime-defined)] [usage prevents renaming] */ -/*! export bio [provided] [unused] [could be renamed] */ -/*! export dob [provided] [unused] [could be renamed] */ -/*! export name [provided] [unused] [could be renamed] */ -/*! export organization [provided] [unused] [could be renamed] */ -/*! other exports [not provided] [unused] */ -/*! export title [provided] [maybe used (runtime-defined)] [usage prevents renaming] */ -/*! other exports [not provided] [maybe used (runtime-defined)] */ +/*! export owner [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export bio [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export dob [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export name [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export organization [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! export title [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ /*! runtime requirements: module */ /***/ ((module) => { @@ -192,35 +218,27 @@ module.exports = JSON.parse("{\"title\":\"JSON5 Example\",\"owner\":{\"name\":\" /******/ } /******/ /************************************************************************/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ ``` ``` js -(() => { -/*!********************!*\ - !*** ./example.js ***! - \********************/ -/*! namespace exports */ -/*! exports [not provided] [unused] */ -/*! runtime requirements: __webpack_require__ */ -/* harmony import */ var _data_toml__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./data.toml */ 1); -/* harmony import */ var _data_yaml__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./data.yaml */ 2); -/* harmony import */ var _data_json5__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./data.json5 */ 3); - - - - -document.querySelector('#app').innerHTML = [_data_toml__WEBPACK_IMPORTED_MODULE_0__, _data_yaml__WEBPACK_IMPORTED_MODULE_1__, _data_json5__WEBPACK_IMPORTED_MODULE_2__].map(data => ` -

${data.title}

-
${data.owner.name}
-
${data.owner.organization}
-
${data.owner.bio}
-
${data.owner.dob}
-`).join('

'); - -})(); - +/******/ // startup +/******/ // Load entry module +/******/ __webpack_require__(0); +/******/ // This entry module used 'exports' so it can't be inlined /******/ })() ; ``` @@ -230,27 +248,14 @@ document.querySelector('#app').innerHTML = [_data_toml__WEBPACK_IMPORTED_MODULE_ ## webpack output ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -output.js 4.83 KiB [emitted] [name: main] -Entrypoint main = output.js -chunk output.js (main) 919 bytes [entry] [rendered] - > ./example.js main - ./data.json5 189 bytes [built] - [exports: owner, title] - harmony side effect evaluation ./data.json5 ./example.js 3:0-32 - harmony import specifier ./data.json5 ./example.js 5:56-60 - ./data.toml 188 bytes [built] - [exports: owner, title] - harmony side effect evaluation ./data.toml ./example.js 1:0-31 - harmony import specifier ./data.toml ./example.js 5:44-48 - ./data.yaml 188 bytes [built] - [exports: owner, title] - harmony side effect evaluation ./data.yaml ./example.js 2:0-31 - harmony import specifier ./data.yaml ./example.js 5:50-54 - ./example.js 354 bytes [built] - [no exports] - [no exports used] - entry ./example.js main +asset output.js 5.98 KiB [emitted] (name: main) +chunk output.js (main) 919 bytes (javascript) 274 bytes (runtime) [entry] [rendered] + > ./example.js main + dependent modules 565 bytes [dependent] 3 modules + runtime modules 274 bytes 1 module + ./example.js 354 bytes [built] [code generated] + [no exports] + [used exports unknown] + entry ./example.js main +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/dll-app-and-vendor/0-vendor/README.md b/examples/dll-app-and-vendor/0-vendor/README.md index 5a1e62977..48094b0b0 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_c6c2f689b0bad44474d1;vendor_lib_c6c2f689b0bad44474d1 = +var vendor_lib_4d8eacf7030dbe3ec0eb;vendor_lib_4d8eacf7030dbe3ec0eb = /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ([ /* 0 */ @@ -49,7 +49,6 @@ var vendor_lib_c6c2f689b0bad44474d1;vendor_lib_c6c2f689b0bad44474d1 = !*** dll main ***! \****************/ /*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ /*! runtime requirements: __webpack_require__, module */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { @@ -61,8 +60,8 @@ module.exports = __webpack_require__; !*** ../node_modules/example-vendor.js ***! \*****************************************/ /*! namespace exports */ -/*! export square [provided] [maybe used (runtime-defined)] [usage prevents renaming] */ -/*! other exports [not provided] [maybe used (runtime-defined)] */ +/*! export square [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { @@ -153,7 +152,7 @@ function square(n) { # dist/vendor-manifest.json ```javascript -{"name":"vendor_lib_c6c2f689b0bad44474d1","content":{"../node_modules/example-vendor.js":{"id":1,"buildMeta":{"exportsType":"namespace","async":false},"exports":["square"]}}} +{"name":"vendor_lib_4d8eacf7030dbe3ec0eb","content":{"../node_modules/example-vendor.js":{"id":1,"buildMeta":{"exportsType":"namespace"},"exports":["square"]}}} ``` # Info @@ -161,37 +160,28 @@ function square(n) { ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -vendor.js 3.65 KiB [emitted] [name: main] -Entrypoint main = vendor.js +asset vendor.js 3.56 KiB [emitted] (name: main) chunk vendor.js (main) 57 bytes (javascript) 668 bytes (runtime) [entry] [rendered] - > main - ../node_modules/example-vendor.js 45 bytes [built] - [exports: square] - entry example-vendor dll main main[0] - dll main 12 bytes [built] - dll entry - used as library export - + 3 hidden chunk modules + > main + runtime modules 668 bytes 3 modules + dependent modules 45 bytes [dependent] 1 module + dll main 12 bytes [built] [code generated] + [used exports unknown] + dll entry + used as library export +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -vendor.js 638 bytes [emitted] [name: main] -Entrypoint main = vendor.js -chunk vendor.js (main) 57 bytes (javascript) 668 bytes (runtime) [entry] [rendered] - > main - ../node_modules/example-vendor.js 45 bytes [built] - [exports: square] - entry example-vendor dll main main[0] - dll main 12 bytes [built] - dll entry - used as library export - + 3 hidden chunk modules +asset vendor.js 638 bytes [emitted] [minimized] (name: main) +chunk (runtime: main) vendor.js (main) 57 bytes (javascript) 668 bytes (runtime) [entry] [rendered] + > main + runtime modules 668 bytes 3 modules + dependent modules 45 bytes [dependent] 1 module + dll main 12 bytes [built] [code generated] + dll entry + used as library export +webpack 5.0.0-beta.32 compiled successfully ``` diff --git a/examples/dll-app-and-vendor/1-app/README.md b/examples/dll-app-and-vendor/1-app/README.md index 62e17db70..f8210398a 100644 --- a/examples/dll-app-and-vendor/1-app/README.md +++ b/examples/dll-app-and-vendor/1-app/README.md @@ -50,31 +50,49 @@ console.log(new square(7)); ```javascript /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ([ -/* 0 */, +/* 0 */ +/*!************************!*\ + !*** ./example-app.js ***! + \************************/ +/*! namespace exports */ +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var example_vendor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! example-vendor */ 1); + + +console.log((0,example_vendor__WEBPACK_IMPORTED_MODULE_0__.square)(7)); +console.log(new example_vendor__WEBPACK_IMPORTED_MODULE_0__.square(7)); + + +/***/ }), /* 1 */ /*!******************************************************************************************************!*\ - !*** delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_c6c2f689b0bad44474d1 ***! + !*** delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_4d8eacf7030dbe3ec0eb ***! \******************************************************************************************************/ /*! namespace exports */ -/*! export square [provided] [used] [provision prevents renaming] */ -/*! other exports [not provided] [unused] */ +/*! export square [provided] [no usage info] [provision prevents renaming (no use info)] */ +/*! other exports [not provided] [no usage info] */ /*! runtime requirements: module, __webpack_require__ */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -module.exports = (__webpack_require__(/*! dll-reference vendor_lib_c6c2f689b0bad44474d1 */ 2))(1); +module.exports = (__webpack_require__(/*! dll-reference vendor_lib_4d8eacf7030dbe3ec0eb */ 2))(1); /***/ }), /* 2 */ /*!**************************************************!*\ - !*** external "vendor_lib_c6c2f689b0bad44474d1" ***! + !*** external "vendor_lib_4d8eacf7030dbe3ec0eb" ***! \**************************************************/ -/*! unknown exports (runtime-defined) */ -/*! exports [maybe provided (runtime-defined)] [maybe used (runtime-defined)] */ +/*! dynamic exports */ +/*! exports [maybe provided (runtime-defined)] [no usage info] */ /*! runtime requirements: module */ /***/ ((module) => { "use strict"; -module.exports = vendor_lib_c6c2f689b0bad44474d1; +module.exports = vendor_lib_4d8eacf7030dbe3ec0eb; /***/ }) /******/ ]); @@ -108,27 +126,27 @@ module.exports = vendor_lib_c6c2f689b0bad44474d1; /******/ } /******/ /************************************************************************/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ ``` ``` js -(() => { -"use strict"; -/*!************************!*\ - !*** ./example-app.js ***! - \************************/ -/*! namespace exports */ -/*! exports [not provided] [unused] */ -/*! runtime requirements: __webpack_require__ */ -/* harmony import */ var example_vendor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! example-vendor */ 1); - - -console.log((0,example_vendor__WEBPACK_IMPORTED_MODULE_0__.square)(7)); -console.log(new example_vendor__WEBPACK_IMPORTED_MODULE_0__.square(7)); - -})(); - +/******/ // startup +/******/ // Load entry module +/******/ __webpack_require__(0); +/******/ // This entry module used 'exports' so it can't be inlined /******/ })() ; ``` @@ -138,49 +156,30 @@ console.log(new example_vendor__WEBPACK_IMPORTED_MODULE_0__.square(7)); ## Unoptimized ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -app.js 2.67 KiB [emitted] [name: main] -Entrypoint main = app.js -chunk app.js (main) 178 bytes [entry] [rendered] - > ./example-app main - ./example-app.js 94 bytes [built] - [no exports] - [no exports used] - entry ./example-app main - delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_c6c2f689b0bad44474d1 42 bytes [built] - [exports: square] - [all exports used] - harmony side effect evaluation example-vendor ./example-app.js 1:0-40 - harmony import specifier example-vendor ./example-app.js 3:12-18 - harmony import specifier example-vendor ./example-app.js 4:16-22 - external "vendor_lib_c6c2f689b0bad44474d1" 42 bytes [built] - delegated source dll-reference vendor_lib_c6c2f689b0bad44474d1 delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_c6c2f689b0bad44474d1 +asset app.js 3.52 KiB [emitted] (name: main) +chunk app.js (main) 178 bytes (javascript) 274 bytes (runtime) [entry] [rendered] + > ./example-app main + dependent modules 84 bytes [dependent] 2 modules + runtime modules 274 bytes 1 module + ./example-app.js 94 bytes [built] [code generated] + [no exports] + [used exports unknown] + entry ./example-app main +webpack 5.0.0-beta.32 compiled successfully ``` ## Production mode ``` -Hash: 0a1b2c3d4e5f6a7b8c9d -Version: webpack 5.0.0-beta.16 - Asset Size -app.js 319 bytes [emitted] [name: main] -Entrypoint main = app.js -chunk app.js (main) 178 bytes [entry] [rendered] - > ./example-app main - ./example-app.js 94 bytes [built] - [no exports] - [no exports used] - entry ./example-app main - delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_c6c2f689b0bad44474d1 42 bytes [built] - [exports: square] - [all exports used] - harmony side effect evaluation example-vendor ./example-app.js 1:0-40 - harmony import specifier example-vendor ./example-app.js 3:12-18 - harmony import specifier example-vendor ./example-app.js 4:16-22 - external "vendor_lib_c6c2f689b0bad44474d1" 42 bytes [built] - delegated source dll-reference vendor_lib_c6c2f689b0bad44474d1 delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_c6c2f689b0bad44474d1 +asset app.js 319 bytes [emitted] [minimized] (name: main) +chunk (runtime: main) app.js (main) 178 bytes [entry] [rendered] + > ./example-app main + dependent modules 84 bytes [dependent] 2 modules + ./example-app.js 94 bytes [built] [code generated] + [no exports] + [no exports used] + entry ./example-app main +webpack 5.0.0-beta.32 compiled successfully ```