diff --git a/.gitignore b/.gitignore index 5d5dd6ca211..5236a987751 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ /benchmark/js /benchmark/fixtures /examples/**/dist +/assembly/**/*.wat +/assembly/**/*.wasm /coverage /.nyc_output /.jest-cache diff --git a/assembly/hash/xxhash64.asm.ts b/assembly/hash/xxhash64.asm.ts new file mode 100644 index 00000000000..3525a77202f --- /dev/null +++ b/assembly/hash/xxhash64.asm.ts @@ -0,0 +1,131 @@ +// ////////////////////////////////////////////////////////// +// xxhash64.h +// Copyright (c) 2016 Stephan Brumme. All rights reserved. +// see http://create.stephan-brumme.com/disclaimer.html +// +// XXHash (64 bit), based on Yann Collet's descriptions, see +// http://cyan4973.github.io/xxHash/ +// +// Modified for hash-wasm by Dani BirĂ³ +// +// Ported to assemblyscript by Tobias Koppers +// Modifications: +// - seed is always 0 +// - update is only called with a multiple of 32 +// - final takes the remaining 0 - 31 bytes +// + +const Prime1: u64 = 11400714785074694791; +const Prime2: u64 = 14029467366897019727; +const Prime3: u64 = 1609587929392839161; +const Prime4: u64 = 9650029242287828579; +const Prime5: u64 = 2870177450012600261; + +let state0: u64; +let state1: u64; +let state2: u64; +let state3: u64; +let totalLength: u64; + +function processSingle(previous: u64, input: u64): u64 { + return rotl(previous + input * Prime2, 31) * Prime1; +} + +export function init(): void { + state0 = Prime1 + Prime2; + state1 = Prime2; + state2 = 0; + state3 = 0 - Prime1; + totalLength = 0; +} + +export function update(length: u32): void { + if (length == 0) return; + + totalLength += length; + + let dataPtr: u32 = 0; + + let s0 = state0; + let s1 = state1; + let s2 = state2; + let s3 = state3; + + do { + s0 = processSingle(s0, load(dataPtr)); + s1 = processSingle(s1, load(dataPtr + 8)); + s2 = processSingle(s2, load(dataPtr + 16)); + s3 = processSingle(s3, load(dataPtr + 24)); + dataPtr += 32; + } while (dataPtr < length); + + state0 = s0; + state1 = s1; + state2 = s2; + state3 = s3; +} + +export function final(length: u32): void { + // fold 256 bit state into one single 64 bit value + let result: u64; + if (totalLength > 0) { + result = + rotl(state0, 1) + rotl(state1, 7) + rotl(state2, 12) + rotl(state3, 18); + result = (result ^ processSingle(0, state0)) * Prime1 + Prime4; + result = (result ^ processSingle(0, state1)) * Prime1 + Prime4; + result = (result ^ processSingle(0, state2)) * Prime1 + Prime4; + result = (result ^ processSingle(0, state3)) * Prime1 + Prime4; + } else { + result = Prime5; + } + + result += totalLength + length; + + let dataPtr: u32 = 0; + + // at least 8 bytes left ? => eat 8 bytes per step + for (; dataPtr + 8 <= length; dataPtr += 8) { + result = + rotl(result ^ processSingle(0, load(dataPtr)), 27) * Prime1 + Prime4; + } + + // 4 bytes left ? => eat those + if (dataPtr + 4 <= length) { + result = rotl(result ^ (load(dataPtr) * Prime1), 23) * Prime2 + Prime3; + dataPtr += 4; + } + + // take care of remaining 0..3 bytes, eat 1 byte per step + while (dataPtr !== length) { + result = rotl(result ^ (load(dataPtr) * Prime5), 11) * Prime1; + dataPtr++; + } + + // mix bits + result ^= result >> 33; + result *= Prime2; + result ^= result >> 29; + result *= Prime3; + result ^= result >> 32; + + store(0, result); + + store(0, u32ToHex(result >> 32)); + store(8, u32ToHex(result & 0xffffffff)); +} + +function u32ToHex(x: u64): u64 { + // from https://johnnylee-sde.github.io/Fast-unsigned-integer-to-hex-string/ + + x = ((x & 0xffff) << 32) | ((x & 0xffff0000) >> 16); + x = ((x & 0x0000ff000000ff00) >> 8) | ((x & 0x000000ff000000ff) << 16); + x = ((x & 0x00f000f000f000f0) >> 4) | ((x & 0x000f000f000f000f) << 8); + + const mask = ((x + 0x0606060606060606) >> 4) & 0x0101010101010101; + + x |= 0x3030303030303030; + + x += 0x27 * mask; + + return x; +} diff --git a/assembly/tsconfig.json b/assembly/tsconfig.json new file mode 100644 index 00000000000..9cd498ea14e --- /dev/null +++ b/assembly/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "assemblyscript/std/assembly.json", + "include": [ + "./**/*.asm.ts" + ] +} diff --git a/cspell.json b/cspell.json index 7aa2415b99f..bf63b78ffbc 100644 --- a/cspell.json +++ b/cspell.json @@ -190,6 +190,7 @@ "hashbang", "webassemblyjs", + "assemblyscript", "fsevents", "watchpack", "tapable", @@ -201,6 +202,7 @@ "MCEP", "traceur", "atlaskit", + "xxhash", "xxhashjs", "systemjs", "skypack", diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index 4eb7eff2877..5f510f63736 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -880,6 +880,10 @@ export interface WebpackOptions { * Options object for in-memory caching. */ export interface MemoryCacheOptions { + /** + * Additionally cache computation of modules that are unchanged and reference only unchanged modules. + */ + cacheUnaffected?: boolean; /** * Number of generations unused cache entries stay in memory cache at minimum (1 = may be removed after unused for a single compilation, ..., Infinity: kept forever). */ @@ -950,6 +954,10 @@ export interface FileCacheOptions { * Number of generations unused cache entries stay in memory cache at minimum (0 = no memory cache used, 1 = may be removed after unused for a single compilation, ..., Infinity: kept forever). Cache entries will be deserialized from disk when removed from memory cache. */ maxMemoryGenerations?: number; + /** + * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory. + */ + memoryCacheUnaffected?: boolean; /** * Name for the cache. Different names will lead to different coexisting caches. */ @@ -1107,9 +1115,13 @@ export interface Experiments { */ buildHttp?: boolean | HttpUriOptions; /** - * Enable build-time execution of modules from the module graph for plugins and loaders. + * Enable additional in memory caching of modules that are unchanged and reference only unchanged modules. + */ + cacheUnaffected?: boolean; + /** + * Apply defaults of next major version. */ - executeModule?: boolean; + futureDefaults?: boolean; /** * Enable module and chunk layers. */ @@ -1633,15 +1645,15 @@ export interface NodeOptions { /** * Include a polyfill for the '__dirname' variable. */ - __dirname?: false | true | "mock" | "eval-only"; + __dirname?: false | true | "warn-mock" | "mock" | "eval-only"; /** * Include a polyfill for the '__filename' variable. */ - __filename?: false | true | "mock" | "eval-only"; + __filename?: false | true | "warn-mock" | "mock" | "eval-only"; /** * Include a polyfill for the 'global' variable. */ - global?: boolean; + global?: false | true | "warn"; } /** * Enables/Disables integrated optimizations. diff --git a/declarations/plugins/HashedModuleIdsPlugin.d.ts b/declarations/plugins/HashedModuleIdsPlugin.d.ts index 931c0bd6036..faea6fb5031 100644 --- a/declarations/plugins/HashedModuleIdsPlugin.d.ts +++ b/declarations/plugins/HashedModuleIdsPlugin.d.ts @@ -4,6 +4,11 @@ * Run `yarn special-lint-fix` to update */ +/** + * Algorithm used for generation the hash (see node.js crypto package). + */ +export type HashFunction = string | typeof import("../../lib/util/Hash"); + export interface HashedModuleIdsPluginOptions { /** * The context directory for creating names. @@ -20,5 +25,5 @@ export interface HashedModuleIdsPluginOptions { /** * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported. */ - hashFunction?: string; + hashFunction?: HashFunction; } diff --git a/declarations/plugins/IgnorePlugin.d.ts b/declarations/plugins/IgnorePlugin.d.ts index e71e3b1e1ff..281504f9f90 100644 --- a/declarations/plugins/IgnorePlugin.d.ts +++ b/declarations/plugins/IgnorePlugin.d.ts @@ -13,11 +13,11 @@ export type IgnorePluginOptions = /** * A RegExp to test the request against. */ - resourceRegExp?: RegExp; + resourceRegExp: RegExp; } | { /** * A filter function for resource and context. */ - checkResource?: (resource: string, context: string) => boolean; + checkResource: (resource: string, context: string) => boolean; }; diff --git a/examples/aggressive-merging/README.md b/examples/aggressive-merging/README.md index 1b3e91e4731..39b58bf00e2 100644 --- a/examples/aggressive-merging/README.md +++ b/examples/aggressive-merging/README.md @@ -65,15 +65,15 @@ asset pageB.bundle.js 8.91 KiB [emitted] (name: pageB) asset pageC.bundle.js 8.91 KiB [emitted] (name: pageC) asset 456.chunk.js 6.28 KiB [emitted] asset 394.chunk.js 606 bytes [emitted] -chunk (runtime: pageB) pageB.bundle.js (pageB) 69 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered] +chunk (runtime: pageB) pageB.bundle.js (pageB) 69 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./pageB pageB - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules ./pageB.js 69 bytes [built] [code generated] [used exports unknown] entry ./pageB pageB -chunk (runtime: pageC) pageC.bundle.js (pageC) 68 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered] +chunk (runtime: pageC) pageC.bundle.js (pageC) 68 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./pageC pageC - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules ./pageC.js 68 bytes [built] [code generated] [used exports unknown] entry ./pageC pageC @@ -89,9 +89,9 @@ chunk (runtime: pageC) 394.chunk.js 42 bytes [rendered] 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.97 KiB (runtime) [entry] [rendered] +chunk (runtime: pageA) pageA.bundle.js (pageA) 69 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./pageA pageA - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules ./pageA.js 69 bytes [built] [code generated] [used exports unknown] entry ./pageA pageA @@ -113,26 +113,26 @@ chunk (runtime: pageA, pageB) 456.chunk.js 5.45 KiB [rendered] 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.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset pageC.bundle.js 1.73 KiB [emitted] [minimized] (name: pageC) -asset pageA.bundle.js 1.72 KiB [emitted] [minimized] (name: pageA) -asset pageB.bundle.js 1.72 KiB [emitted] [minimized] (name: pageB) +asset pageC.bundle.js 1.74 KiB [emitted] [minimized] (name: pageC) +asset pageA.bundle.js 1.73 KiB [emitted] [minimized] (name: pageA) +asset pageB.bundle.js 1.73 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.97 KiB (runtime) [entry] [rendered] +chunk (runtime: pageB) pageB.bundle.js (pageB) 69 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./pageB pageB - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 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.97 KiB (runtime) [entry] [rendered] +chunk (runtime: pageC) pageC.bundle.js (pageC) 68 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./pageC pageC - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules ./pageC.js 68 bytes [built] [code generated] [no exports used] entry ./pageC pageC @@ -148,9 +148,9 @@ chunk (runtime: pageC) 394.chunk.js 42 bytes [rendered] 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.97 KiB (runtime) [entry] [rendered] +chunk (runtime: pageA) pageA.bundle.js (pageA) 69 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./pageA pageA - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules ./pageA.js 69 bytes [built] [code generated] [no exports used] entry ./pageA pageA @@ -172,5 +172,5 @@ chunk (runtime: pageA, pageB) 456.chunk.js 5.45 KiB [rendered] 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.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/asset-advanced/README.md b/examples/asset-advanced/README.md index 73e519639c2..78756932738 100644 --- a/examples/asset-advanced/README.md +++ b/examples/asset-advanced/README.md @@ -74,48 +74,7 @@ module.exports = { /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ([ -/* 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 _images_file_svg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./images/file.svg */ 1); - - -const container = document.createElement("div"); -Object.assign(container.style, { - display: "flex", - justifyContent: "center" -}); -document.body.appendChild(container); - -function createImageElement(title, src) { - const div = document.createElement("div"); - div.style.textAlign = "center"; - - const h2 = document.createElement("h2"); - h2.textContent = title; - div.appendChild(h2); - - const img = document.createElement("img"); - img.setAttribute("src", src); - img.setAttribute("width", "150"); - div.appendChild(img); - - container.appendChild(div); -} - -[_images_file_svg__WEBPACK_IMPORTED_MODULE_0__].forEach(src => { - createImageElement(src.split(".").pop(), src); -}); - - -/***/ }), +/* 0 */, /* 1 */ /*!*************************!*\ !*** ./images/file.svg ***! @@ -141,8 +100,9 @@ module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.or...3c/svg%3e" /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -176,10 +136,48 @@ module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.or...3c/svg%3e" ``` js -/******/ // startup -/******/ // Load entry module -/******/ __webpack_require__(0); -/******/ // This entry module used 'exports' so it can't be inlined +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { +/*!********************!*\ + !*** ./example.js ***! + \********************/ +/*! namespace exports */ +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.r, __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); + + +const container = document.createElement("div"); +Object.assign(container.style, { + display: "flex", + justifyContent: "center" +}); +document.body.appendChild(container); + +function createImageElement(title, src) { + const div = document.createElement("div"); + div.style.textAlign = "center"; + + const h2 = document.createElement("h2"); + h2.textContent = title; + div.appendChild(h2); + + const img = document.createElement("img"); + img.setAttribute("src", src); + img.setAttribute("width", "150"); + div.appendChild(img); + + container.appendChild(div); +} + +[_images_file_svg__WEBPACK_IMPORTED_MODULE_0__].forEach(src => { + createImageElement(src.split(".").pop(), src); +}); + +})(); + /******/ })() ; ``` @@ -189,7 +187,7 @@ module.exports = "data:image/svg+xml,%3csvg xmlns='http://www.w3.or...3c/svg%3e" ## webpack output ``` -asset output.js 3.86 KiB [emitted] (name: main) +asset output.js 3.81 KiB [emitted] (name: main) chunk (runtime: main) output.js (main) 1.54 KiB (javascript) 274 bytes (runtime) [entry] [rendered] > ./example.js main dependent modules 915 bytes [dependent] 1 module @@ -198,5 +196,5 @@ chunk (runtime: main) output.js (main) 1.54 KiB (javascript) 274 bytes (runtime) [no exports] [used exports unknown] entry ./example.js main -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/asset-simple/README.md b/examples/asset-simple/README.md index 0841a580c8e..29a868a6bf6 100644 --- a/examples/asset-simple/README.md +++ b/examples/asset-simple/README.md @@ -61,52 +61,7 @@ module.exports = { /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ([ -/* 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 _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); - - - - -const container = document.createElement("div"); -Object.assign(container.style, { - display: "flex", - justifyContent: "center" -}); -document.body.appendChild(container); - -function createImageElement(title, src) { - const div = document.createElement("div"); - div.style.textAlign = "center"; - - const h2 = document.createElement("h2"); - h2.textContent = title; - div.appendChild(h2); - - const img = document.createElement("img"); - img.setAttribute("src", src); - img.setAttribute("width", "150"); - div.appendChild(img); - - container.appendChild(div); -} - -[_images_file_png__WEBPACK_IMPORTED_MODULE_0__, _images_file_jpg__WEBPACK_IMPORTED_MODULE_1__, _images_file_svg__WEBPACK_IMPORTED_MODULE_2__].forEach(src => { - createImageElement(src.split(".").pop(), src); -}); - - -/***/ }), +/* 0 */, /* 1 */ /*!*************************!*\ !*** ./images/file.png ***! @@ -156,8 +111,9 @@ module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDo...vc3ZnPgo=" /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -196,10 +152,52 @@ module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDo...vc3ZnPgo=" ``` js -/******/ // startup -/******/ // Load entry module -/******/ __webpack_require__(0); -/******/ // This entry module used 'exports' so it can't be inlined +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { +/*!********************!*\ + !*** ./example.js ***! + \********************/ +/*! namespace exports */ +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.r, __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); + + + + +const container = document.createElement("div"); +Object.assign(container.style, { + display: "flex", + justifyContent: "center" +}); +document.body.appendChild(container); + +function createImageElement(title, src) { + const div = document.createElement("div"); + div.style.textAlign = "center"; + + const h2 = document.createElement("h2"); + h2.textContent = title; + div.appendChild(h2); + + const img = document.createElement("img"); + img.setAttribute("src", src); + img.setAttribute("width", "150"); + div.appendChild(img); + + container.appendChild(div); +} + +[_images_file_png__WEBPACK_IMPORTED_MODULE_0__, _images_file_jpg__WEBPACK_IMPORTED_MODULE_1__, _images_file_svg__WEBPACK_IMPORTED_MODULE_2__].forEach(src => { + createImageElement(src.split(".").pop(), src); +}); + +})(); + /******/ })() ; ``` @@ -219,5 +217,5 @@ chunk (runtime: main) output.js (main) 9.58 KiB (javascript) 14.6 KiB (asset) 30 [no exports] [used exports unknown] entry ./example.js main -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/build-http/README.md b/examples/build-http/README.md index 9e53baf8e3b..8c46cd3b81f 100644 --- a/examples/build-http/README.md +++ b/examples/build-http/README.md @@ -30,28 +30,14 @@ module.exports = { ## Unoptimized ``` -asset output.js 61.7 KiB [emitted] (name: main) +asset output.js 82.6 KiB [emitted] (name: main) runtime modules 670 bytes 3 modules -modules by path https:// 21.9 KiB - modules by path https://jspm.dev/ 8.43 KiB +modules by path https:// 30 KiB + modules by path https://jspm.dev/ 16.1 KiB modules by path https://jspm.dev/*.0 6.04 KiB 5 modules - modules by path https://jspm.dev/npm:@jspm/ 1.99 KiB - https://jspm.dev/npm:@jspm/core@2/nodelibs/os 126 bytes [built] [code generated] - [exports: EOL, arch, cpus, default, endianness, freemem, getNetworkInterfaces, homedir, hostname, loadavg, networkInterfaces, platform, release, tmpDir, tmpdir, totalmem, type, uptime] - [used exports unknown] - harmony side effect evaluation /npm:@jspm/core@2/nodelibs/os https://jspm.dev/npm:clean-stack@4 1:0-39 - harmony side effect evaluation ./npm:@jspm/core@2/nodelibs/os https://jspm.dev/npm:clean-stack@4.1.0 1:0-48 - harmony import specifier ./npm:@jspm/core@2/nodelibs/os https://jspm.dev/npm:clean-stack@4.1.0 6:23-33 - harmony import specifier ./npm:@jspm/core@2/nodelibs/os https://jspm.dev/npm:clean-stack@4.1.0 6:57-67 - https://jspm.dev/npm:@jspm/core@2.0.0-beta.8/nodelibs/os 1.87 KiB [built] [code generated] - [exports: EOL, arch, cpus, default, endianness, freemem, getNetworkInterfaces, homedir, hostname, loadavg, networkInterfaces, platform, release, tmpDir, tmpdir, totalmem, type, uptime] - [used exports unknown] - harmony side effect evaluation /npm:@jspm/core@2.0.0-beta.8/nodelibs/os https://jspm.dev/npm:@jspm/core@2/nodelibs/os 1:0-57 - harmony export imported specifier /npm:@jspm/core@2.0.0-beta.8/nodelibs/os https://jspm.dev/npm:@jspm/core@2/nodelibs/os 1:0-57 - harmony side effect evaluation /npm:@jspm/core@2.0.0-beta.8/nodelibs/os https://jspm.dev/npm:@jspm/core@2/nodelibs/os 2:0-67 - harmony export imported specifier /npm:@jspm/core@2.0.0-beta.8/nodelibs/os https://jspm.dev/npm:@jspm/core@2/nodelibs/os 2:0-67 + modules by path https://jspm.dev/npm:@jspm/ 9.67 KiB 3 modules 4 modules - modules by path https://cdn.esm.sh/ 5.72 KiB 7 modules + modules by path https://cdn.esm.sh/ 6.15 KiB 7 modules modules by path https://cdn.skypack.dev/ 7.46 KiB 6 modules https://unpkg.com/p-map-series?module 263 bytes [built] [code generated] [exports: default] @@ -62,17 +48,17 @@ modules by path https:// 21.9 KiB [no exports] [used exports unknown] entry ./example.js main -webpack 5.48.0 compiled successfully +webpack 5.53.0 compiled successfully ``` ## Production mode ``` -asset output.js 11.4 KiB [emitted] [minimized] (name: main) -orphan modules 21.9 KiB [orphan] 25 modules -./example.js + 24 modules 22.1 KiB [built] [code generated] +asset output.js 12.5 KiB [emitted] [minimized] (name: main) +orphan modules 30 KiB [orphan] 26 modules +./example.js + 25 modules 30.2 KiB [built] [code generated] [no exports] [no exports used] entry ./example.js main -webpack 5.48.0 compiled successfully +webpack 5.53.0 compiled successfully ``` diff --git a/examples/build-http/webpack.lock b/examples/build-http/webpack.lock index f0b1d62335c..f696523fd3e 100644 --- a/examples/build-http/webpack.lock +++ b/examples/build-http/webpack.lock @@ -1,19 +1,20 @@ { - "https://cdn.esm.sh/p-map": { "integrity": "sha512-Q1RsGrT9Fl5eqmmFQbaCy4PcXRx90TZQCcHDWC6sN0vfEnco9o66mi1DNjaWD2HE40qn0cNTWoZ21RIH+jmeiQ==", "contentType": "application/javascript; charset=utf-8" }, - "https://cdn.esm.sh/v43/aggregate-error@4.0.0/es2015/aggregate-error.js": { "integrity": "sha512-nnqEIbQNpkAb5idk+07Wbc8lNzPloQrPAs+SOjccU+va8qftYFcn0htGVwUqwvkWJHZaJn9/B5bXB2YZVzwvUg==", "contentType": "application/javascript" }, - "https://cdn.esm.sh/v43/clean-stack@4.1.0/es2015/clean-stack.js": { "integrity": "sha512-B6h1ZeTzVvZeNUbWJUvEIBPaTvyUnbNEaO+V0aREh7nR1OrFUON/xnG+jwJwEzLWACqQNKFeFiPBOlFowUZ5FQ==", "contentType": "application/javascript" }, - "https://cdn.esm.sh/v43/escape-string-regexp@5.0.0/es2015/escape-string-regexp.js": { "integrity": "sha512-e6uaGCpjIjNgUN5K6nm+BQ3HrIKj59Z/ySJDt86eOM1j7ri1PFvpRFq7JwyjGZ0mhNq/j4ywqNmmk7HEji1Chg==", "contentType": "application/javascript" }, - "https://cdn.esm.sh/v43/indent-string@5.0.0/es2015/indent-string.js": { "integrity": "sha512-yNbq6+IcXe6jW+HIM/dCPxvi1+NJRxo5msNe0Vdg4NqVVUV4DF8U2eJPehmKT0Xhv1viyaTiReidhB1BmE1f/A==", "contentType": "application/javascript" }, - "https://cdn.esm.sh/v43/os-browserify@0.3.0/es2015/browser.js": { "integrity": "sha512-/BeiBawWpXZlWTjmXwtmrZbBeYgD0BqB9LE3EDf4yxBYqASwZ7Xj2dYNruM3/WMbJYyjP/TSRdwuKMsNLWdZbw==", "contentType": "application/javascript" }, - "https://cdn.esm.sh/v43/p-map@5.1.0/es2015/p-map.js": { "integrity": "sha512-DLSkffQJHasMXlosBDDFEIn7zgcLUW5KrTHy5/3IFsrmQO+9zlYjlWQbDJEShfvDzFEhXJc9D4ppP6zykBK/ZA==", "contentType": "application/javascript" }, + "https://cdn.esm.sh/p-map": { "integrity": "sha512-TfztRxlC5elIRa7x3oz4bfhtxJr5hIhoa+bliQkroNj8haEMPp1mv/eAsfzBt032G1oK6JT6y3135FP0vRh13Q==", "contentType": "application/javascript; charset=utf-8" }, + "https://cdn.esm.sh/v53/aggregate-error@4.0.0/es2015/aggregate-error.js": { "integrity": "sha512-4iHvwySJO0Dn0aenl2XY1XCGEoMZFaJ+PkuO8Op0BRVNwHiZaKrCuMnPZqUblPhvAG2o8SEA4JdB/fhS3IQZLg==", "contentType": "application/javascript" }, + "https://cdn.esm.sh/v53/clean-stack@4.1.0/es2015/clean-stack.js": { "integrity": "sha512-VzcwF50IxKsmW4O2DpY8WB6TmYh9caBctTqA2EkE3p9K8JjITMD/qBNqfVmUKAlmq4CFgI3c0xegzMf1BRWbyQ==", "contentType": "application/javascript" }, + "https://cdn.esm.sh/v53/escape-string-regexp@5.0.0/es2015/escape-string-regexp.js": { "integrity": "sha512-vst7rz+jFlvZMjo5GUzNBSq7QvFoaqOQ+hDq0m40ZJYGts6ptt+QKLZOMDWgoEq3Fabnhiy+hsoIfaHMmVdbSQ==", "contentType": "application/javascript" }, + "https://cdn.esm.sh/v53/indent-string@5.0.0/es2015/indent-string.js": { "integrity": "sha512-o1hDF1EyRTCiDpcxD2i0XpIuHCMFrc9XkKrkMISIaiWpJdKU7HBRhtqXfBcpVfJF1uNAFJ7/1v40vpPH2r7X8w==", "contentType": "application/javascript" }, + "https://cdn.esm.sh/v53/os-browserify@0.3.0/es2015/browser.js": { "integrity": "sha512-8JOZWkDGX6WNFtXIk/aOawVo35LZSIgCdbMrleK4QL8kHcYti2oTjfqfn99AJm6SOUsTt0uY5K808uHAvVe3eA==", "contentType": "application/javascript" }, + "https://cdn.esm.sh/v53/p-map@5.1.0/es2015/p-map.js": { "integrity": "sha512-3kEIICBOLKnEn6SNNixOBy+VGgwh0DYtn07yxHfagwiSJV8om7q/37RdHVbQ2pol8B/6oVMHo7Y6YYhmpYKDUA==", "contentType": "application/javascript" }, "https://cdn.skypack.dev/-/aggregate-error@v4.0.0-rCH8s5R9g4kQQ807o58j/dist=es2020,mode=imports/optimized/aggregate-error.js": { "integrity": "sha512-E5rN3mgPTqyfHSovQ++ZyZWQkMUniuyjbeHHX+E4G3MStEx6TfObScB8tfHeIyuawSp86nVsFfMZjCruD61rdg==", "contentType": "application/javascript; charset=utf-8" }, "https://cdn.skypack.dev/-/clean-stack@v4.1.0-DgWUKXHVzThBBZtsHXhC/dist=es2020,mode=imports/optimized/clean-stack.js": { "integrity": "sha512-1nEMT4Vc2YLu3EbeBnck7Traj0/D6G9MMSGraGpsoQIMKVuhQjq4gP76X6RxUn5GoiHv90KfrFMSWlbBn26Dhw==", "contentType": "application/javascript; charset=utf-8" }, "https://cdn.skypack.dev/-/escape-string-regexp@v5.0.0-SUDdAhYOdAgXIYndxZss/dist=es2020,mode=imports/optimized/escape-string-regexp.js": { "integrity": "sha512-54oHYow5obgsKb0twQZMNLvCH2tV5MCOY4YHB0LQH+zVonIAn7JYZseUPWhC3MMkJFK5EkeNWDAX7P2camp27g==", "contentType": "application/javascript; charset=utf-8" }, "https://cdn.skypack.dev/-/indent-string@v5.0.0-VgKPSgi4hUX5NbF4n3aC/dist=es2020,mode=imports/optimized/indent-string.js": { "integrity": "sha512-lSZAs06jEHkVlPMEeMtKbygGhrSmJUMVmpB6/2ChdG2F0694vRU1v6N12bUyqR5uGbbteTJ7atP5PmPtTVmlcw==", "contentType": "application/javascript; charset=utf-8" }, "https://cdn.skypack.dev/-/p-map@v5.1.0-7ixXvZxXPKKt9unR9LT0/dist=es2020,mode=imports/optimized/p-map.js": { "integrity": "sha512-mZyhNJe8VlqEqafSkUGTooFrKcQPSwVjB3UxAAPqywSFD+age77uTRP6ul8uAMEQ3lllmengXX1q45igRxRcDw==", "contentType": "application/javascript; charset=utf-8" }, "https://cdn.skypack.dev/p-map": { "integrity": "sha512-FFu6R9j8mrGqTvw8WL37XsWhI9P65XdPD9Jfs/47jiYNdex12f0XJNsIy+fI81PbOkCuEQRgm2nf0P76ieBlag==", "contentType": "application/javascript; charset=utf-8" }, - "https://jspm.dev/npm:@jspm/core@2.0.0-beta.8/nodelibs/os": { "integrity": "sha512-bNMLa9/IfXCZprEMIuXuHM/9s4OFAl4ZKy8r6EdXNkduLNLHQ626srFqLRdWHx6ZWGIgppc1bI9+tRJT3FzfAw==", "contentType": "application/javascript; charset=utf-8" }, - "https://jspm.dev/npm:@jspm/core@2/nodelibs/os": { "integrity": "sha512-rPwqsk0nq0tqTCdbeGoopnlzAVh5BsaVUsXoFKQCcb04LWJrXmOhQEwj1Yj/WHfNj2ZIPzODlZdKtWZl5bbIpA==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/npm:@jspm/core@2.0.0-beta.11/nodelibs/os": { "integrity": "sha512-Jsg9UMzfNTnlPDu6FeftYzdp6XULJwLDI7xFSzULhMqjQUoOIHJhkAToEgr3NnEKCkLZQMIPuBvHAn0ud6gT+w==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/npm:@jspm/core@2.0.0-beta.11/nodelibs/process": { "integrity": "sha512-KIYEmkrnT7TL5EKA5coPbbdoqfL2twHFBVXKTZS+PU5aZFX90yELxZHrm4DhxSQ33FLAWo51/nQLQmqGekWNMw==", "contentType": "application/javascript; charset=utf-8" }, + "https://jspm.dev/npm:@jspm/core@2/nodelibs/os": { "integrity": "sha512-g2ppEW1AVdbIpc486D0ZmLIR5CtzMITkBwqoBgxvhiIq5/qHP4/unZ7Czk3q8A1UwdTI4wbGzRWndXAUa4/Q0Q==", "contentType": "application/javascript; charset=utf-8" }, "https://jspm.dev/npm:aggregate-error@4": { "integrity": "sha512-XfXd6EZ09/SKLmWFFvjPCSkqv0E08IxKc8mFm9mePyLIiEiGyAKokeFt1wql+kG8ikGmI7YqKBsDf07/I31VvA==", "contentType": "application/javascript; charset=utf-8" }, "https://jspm.dev/npm:aggregate-error@4.0.0": { "integrity": "sha512-HEobsVYXVCp5H4Z+6qAlKno8XAJwHQrfF4ivR4PHrp4ttM0Yg0zDfOcsjqJOnTP5hEnKR1K6OzQdPfR2r9of4g==", "contentType": "application/javascript; charset=utf-8" }, "https://jspm.dev/npm:clean-stack@4": { "integrity": "sha512-3wh/QTJY4tw/GInIcn5I+0hsHSirJi8Tf3kmH85hzQsuwB5k2lghBFZyKZPO7/Ql3muvZeDgN02pYkZap59Qrw==", "contentType": "application/javascript; charset=utf-8" }, diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/p-map_9a051b191b6af4b352ba b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/p-map_9a051b191b6af4b352ba deleted file mode 100644 index 09db000630f..00000000000 --- a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/p-map_9a051b191b6af4b352ba +++ /dev/null @@ -1,3 +0,0 @@ -/* esm.sh - p-map@5.1.0 */ -export * from "https://cdn.esm.sh/v43/p-map@5.1.0/es2015/p-map.js"; -export { default } from "https://cdn.esm.sh/v43/p-map@5.1.0/es2015/p-map.js"; diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/p-map_9dd32c023fd5f3d3e7f2 b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/p-map_9dd32c023fd5f3d3e7f2 new file mode 100644 index 00000000000..5034fb3895a --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/p-map_9dd32c023fd5f3d3e7f2 @@ -0,0 +1,3 @@ +/* esm.sh - p-map@5.1.0 */ +export * from "https://cdn.esm.sh/v53/p-map@5.1.0/es2015/p-map.js"; +export { default } from "https://cdn.esm.sh/v53/p-map@5.1.0/es2015/p-map.js"; diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_aggregate-error_4.0.0_es2015_aggregate-error_89888e7f244a2b227be9.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_aggregate-error_4.0.0_es2015_aggregate-error_89888e7f244a2b227be9.js deleted file mode 100644 index 0fa8ce04381..00000000000 --- a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_aggregate-error_4.0.0_es2015_aggregate-error_89888e7f244a2b227be9.js +++ /dev/null @@ -1,3 +0,0 @@ -var f=Object.defineProperty;var l=(e,t,n)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var i=(e,t,n)=>(l(e,typeof t!="symbol"?t+"":t,n),n),g=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var c=(e,t,n)=>(g(e,t,"read from private field"),n?n.call(e):t.get(e)),o=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},p=(e,t,n,a)=>(g(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n);import u from"/v43/indent-string@5.0.0/es2015/indent-string.js";import m from"/v43/clean-stack@4.1.0/es2015/clean-stack.js";var d=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""),r,s=class extends Error{constructor(t){o(this,r,void 0);i(this,"name","AggregateError");if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=t.map(a=>a instanceof Error?a:a!==null&&typeof a=="object"?Object.assign(new Error(a.message),a):new Error(a));let n=t.map(a=>typeof a.stack=="string"?d(m(a.stack)):String(a)).join(` -`);n=` -`+u(n,4),super(n),p(this,r,t)}get errors(){return c(this,r).slice()}};r=new WeakMap;export{s as default}; \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_clean-stack_4.1.0_es2015_clean-stack_512fad7a42bd85149e06.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_clean-stack_4.1.0_es2015_clean-stack_512fad7a42bd85149e06.js deleted file mode 100644 index d2024661d22..00000000000 --- a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_clean-stack_4.1.0_es2015_clean-stack_512fad7a42bd85149e06.js +++ /dev/null @@ -1,3 +0,0 @@ -import s from"/v43/os-browserify@0.3.0/es2015/browser.js";import i from"/v43/escape-string-regexp@5.0.0/es2015/escape-string-regexp.js";var p=/\s+at.*[(\s](.*)\)?/,f=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/,u=typeof s.homedir=="undefined"?"":s.homedir().replace(/\\/g,"/");function c(a,{pretty:l=!1,basePath:n}={}){let o=n&&new RegExp(`(at | \\()${i(n.replace(/\\/g,"/"))}`,"g");if(typeof a=="string")return a.replace(/\\/g,"/").split(` -`).filter(e=>{let r=e.match(p);if(r===null||!r[1])return!0;let t=r[1];return t.includes(".app/Contents/Resources/electron.asar")||t.includes(".app/Contents/Resources/default_app.asar")?!1:!f.test(t)}).filter(e=>e.trim()!=="").map(e=>(o&&(e=e.replace(o,"$1")),l&&(e=e.replace(p,(r,t)=>r.replace(t,t.replace(u,"~")))),e)).join(` -`)}export{c as default}; \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_p-map_5.1.0_es2015_p-map_2e9e4310942f189ff123.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_p-map_5.1.0_es2015_p-map_2e9e4310942f189ff123.js deleted file mode 100644 index 0202cd3f60c..00000000000 --- a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_p-map_5.1.0_es2015_p-map_2e9e4310942f189ff123.js +++ /dev/null @@ -1 +0,0 @@ -var m=(p,s,e)=>new Promise((f,x)=>{var h=t=>{try{o(e.next(t))}catch(r){x(r)}},l=t=>{try{o(e.throw(t))}catch(r){x(r)}},o=t=>t.done?f(t.value):Promise.resolve(t.value).then(h,l);o((e=e.apply(p,s)).next())});import S from"/v43/aggregate-error@4.0.0/es2015/aggregate-error.js";function N(x,h){return m(this,arguments,function*(p,s,{concurrency:e=Number.POSITIVE_INFINITY,stopOnError:f=!0}={}){return new Promise((l,o)=>{if(typeof s!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(e)||e===Number.POSITIVE_INFINITY)&&e>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${e}\` (${typeof e})`);let t=[],r=[],g=[],y=p[Symbol.iterator](),u=!1,c=!1,a=0,b=0,I=()=>{if(u)return;let i=y.next(),d=b;if(b++,i.done){if(c=!0,a===0)if(!f&&r.length>0)o(new S(r));else{for(let n of g)t.splice(n,1);l(t)}return}a++,(()=>m(this,null,function*(){try{let n=yield i.value;if(u)return;let w=yield s(n,d);w===T?g.push(d):t[d]=w,a--,I()}catch(n){f?(u=!0,o(n)):(r.push(n),a--,I())}}))()};for(let i=0;it in n?l(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>(f(n,typeof t!="symbol"?t+"":t,e),e),i=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)};var c=(n,t,e)=>(i(n,t,"read from private field"),e?e.call(n):t.get(n)),g=(n,t,e)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,e)},o=(n,t,e,a)=>(i(n,t,"write to private field"),a?a.call(n,e):t.set(n,e),e);import u from"/v53/indent-string@5.0.0/es2015/indent-string.js";import m from"/v53/clean-stack@4.1.0/es2015/clean-stack.js";var d=n=>n.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""),r,p=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=t.map(a=>a instanceof Error?a:a!==null&&typeof a=="object"?Object.assign(new Error(a.message),a):new Error(a));let e=t.map(a=>typeof a.stack=="string"?d(m(a.stack)):String(a)).join(` +`);e=` +`+u(e,4);super(e);g(this,r,void 0);s(this,"name","AggregateError");o(this,r,t)}get errors(){return c(this,r).slice()}};r=new WeakMap;export{p as default}; diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_clean-stack_4.1.0_es2015_clean-stack_87b32b37ae264a8e8a1c.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_clean-stack_4.1.0_es2015_clean-stack_87b32b37ae264a8e8a1c.js new file mode 100644 index 00000000000..a3c644a1fb2 --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_clean-stack_4.1.0_es2015_clean-stack_87b32b37ae264a8e8a1c.js @@ -0,0 +1,4 @@ +/* esm.sh - esbuild bundle(clean-stack@4.1.0) es2015 production */ +import s from"/v53/os-browserify@0.3.0/es2015/browser.js";import i from"/v53/escape-string-regexp@5.0.0/es2015/escape-string-regexp.js";var p=/\s+at.*[(\s](.*)\)?/,l=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/,f=typeof s.homedir=="undefined"?"":s.homedir().replace(/\\/g,"/");function u(n,{pretty:c=!1,basePath:a}={}){let o=a&&new RegExp(`(at | \\()${i(a.replace(/\\/g,"/"))}`,"g");if(typeof n=="string")return n.replace(/\\/g,"/").split(` +`).filter(e=>{let r=e.match(p);if(r===null||!r[1])return!0;let t=r[1];return t.includes(".app/Contents/Resources/electron.asar")||t.includes(".app/Contents/Resources/default_app.asar")?!1:!l.test(t)}).filter(e=>e.trim()!=="").map(e=>(o&&(e=e.replace(o,"$1")),c&&(e=e.replace(p,(r,t)=>r.replace(t,t.replace(f,"~")))),e)).join(` +`)}export{u as default}; diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_escape-string-regexp_5.0.0_es2015_escape-string-regexp_22382d8d9f837184e161.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_escape-string-regexp_5.0.0_es2015_escape-string-regexp_2c814e466860133eca86.js similarity index 52% rename from examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_escape-string-regexp_5.0.0_es2015_escape-string-regexp_22382d8d9f837184e161.js rename to examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_escape-string-regexp_5.0.0_es2015_escape-string-regexp_2c814e466860133eca86.js index 4c87ee6f361..a70aa3b9a9e 100644 --- a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_escape-string-regexp_5.0.0_es2015_escape-string-regexp_22382d8d9f837184e161.js +++ b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_escape-string-regexp_5.0.0_es2015_escape-string-regexp_2c814e466860133eca86.js @@ -1 +1,2 @@ -function r(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}export{r as default}; \ No newline at end of file +/* esm.sh - esbuild bundle(escape-string-regexp@5.0.0) es2015 production */ +function r(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}export{r as default}; diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_indent-string_5.0.0_es2015_indent-string_6103e1cfb4ff573a03ed.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_indent-string_5.0.0_es2015_indent-string_171b2b5ba89965a085b6.js similarity index 50% rename from examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_indent-string_5.0.0_es2015_indent-string_6103e1cfb4ff573a03ed.js rename to examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_indent-string_5.0.0_es2015_indent-string_171b2b5ba89965a085b6.js index 67abd53aedd..758f021c33e 100644 --- a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_indent-string_5.0.0_es2015_indent-string_6103e1cfb4ff573a03ed.js +++ b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_indent-string_5.0.0_es2015_indent-string_171b2b5ba89965a085b6.js @@ -1 +1,2 @@ -function o(t,e=1,n={}){let{indent:r=" ",includeEmptyLines:p=!1}=n;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof r!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r}\``);if(e===0)return t;let i=p?/^/gm:/^(?!\s*$)/gm;return t.replace(i,r.repeat(e))}export{o as default}; \ No newline at end of file +/* esm.sh - esbuild bundle(indent-string@5.0.0) es2015 production */ +function i(t,e=1,o={}){let{indent:r=" ",includeEmptyLines:n=!1}=o;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof r!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r}\``);if(e===0)return t;let p=n?/^/gm:/^(?!\s*$)/gm;return t.replace(p,r.repeat(e))}export{i as default}; diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_os-browserify_0.3.0_es2015_browser_92a2351b7a3273e492dd.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_os-browserify_0.3.0_es2015_browser_476a088316baaea08336.js similarity index 66% rename from examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_os-browserify_0.3.0_es2015_browser_92a2351b7a3273e492dd.js rename to examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_os-browserify_0.3.0_es2015_browser_476a088316baaea08336.js index 2d987fbea9c..951e12edff7 100644 --- a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v43_os-browserify_0.3.0_es2015_browser_92a2351b7a3273e492dd.js +++ b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_os-browserify_0.3.0_es2015_browser_476a088316baaea08336.js @@ -1,2 +1,3 @@ +/* esm.sh - esbuild bundle(os-browserify@0.3.0/browser) es2015 production */ var f=Object.create;var o=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var d=e=>o(e,"__esModule",{value:!0});var l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var w=(e,t,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of m(t))!p.call(e,n)&&n!=="default"&&o(e,n,{get:()=>t[n],enumerable:!(i=s(t,n))||i.enumerable});return e},a=e=>w(d(o(e!=null?f(c(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var u=l(r=>{r.endianness=function(){return"LE"};r.hostname=function(){return typeof location!="undefined"?location.hostname:""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){return typeof navigator!="undefined"?navigator.appVersion:""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL=` -`;r.homedir=function(){return"/"}});var b=a(u()),h=a(u()),{cpus:v,release:E,tmpDir:L,loadavg:k,uptime:A,totalmem:I,arch:N,tmpdir:_,homedir:V,endianness:x,hostname:D,type:M,freemem:O,networkInterfaces:U,getNetworkInterfaces:X,platform:j,EOL:B}=b;var export_default=h.default;export{B as EOL,N as arch,v as cpus,export_default as default,x as endianness,O as freemem,X as getNetworkInterfaces,V as homedir,D as hostname,k as loadavg,U as networkInterfaces,j as platform,E as release,L as tmpDir,_ as tmpdir,I as totalmem,M as type,A as uptime}; \ No newline at end of file +`;r.homedir=function(){return"/"}});var b=a(u()),h=a(u()),{endianness:v,hostname:E,loadavg:L,uptime:k,freemem:A,totalmem:I,cpus:N,type:_,release:V,networkInterfaces:x,getNetworkInterfaces:D,arch:M,platform:O,tmpdir:U,tmpDir:X,EOL:j,homedir:B}=b;var export_default=h.default;export{j as EOL,M as arch,N as cpus,export_default as default,v as endianness,A as freemem,D as getNetworkInterfaces,B as homedir,E as hostname,L as loadavg,x as networkInterfaces,O as platform,V as release,X as tmpDir,U as tmpdir,I as totalmem,_ as type,k as uptime}; diff --git a/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_p-map_5.1.0_es2015_p-map_cd0c09542673ea9d78f0.js b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_p-map_5.1.0_es2015_p-map_cd0c09542673ea9d78f0.js new file mode 100644 index 00000000000..8baf6a8521d --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_cdn.esm.sh/v53_p-map_5.1.0_es2015_p-map_cd0c09542673ea9d78f0.js @@ -0,0 +1,2 @@ +/* esm.sh - esbuild bundle(p-map@5.1.0) es2015 production */ +var g=(l,s,e)=>new Promise((f,x)=>{var N=t=>{try{n(e.next(t))}catch(r){x(r)}},p=t=>{try{n(e.throw(t))}catch(r){x(r)}},n=t=>t.done?f(t.value):Promise.resolve(t.value).then(N,p);n((e=e.apply(l,s)).next())});import y from"/v53/aggregate-error@4.0.0/es2015/aggregate-error.js";function S(x,N){return g(this,arguments,function*(l,s,{concurrency:e=Number.POSITIVE_INFINITY,stopOnError:f=!0}={}){return new Promise((p,n)=>{if(typeof s!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(e)||e===Number.POSITIVE_INFINITY)&&e>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${e}\` (${typeof e})`);let t=[],r=[],m=[],h=l[Symbol.iterator](),u=!1,c=!1,a=0,b=0,I=()=>{if(u)return;let i=h.next(),d=b;if(b++,i.done){if(c=!0,a===0)if(!f&&r.length>0)n(new y(r));else{for(let o of m)t.splice(o,1);p(t)}return}a++,(()=>g(this,null,function*(){try{let o=yield i.value;if(u)return;let w=yield s(o,d);w===T?m.push(d):t[d]=w,a--,I()}catch(o){f?(u=!0,n(o)):(r.push(o),a--,I())}}))()};for(let i=0;i 1) { + for (var i = 1; i < arguments.length; i++) + args[i - 1] = arguments[i]; + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) + setTimeout(drainQueue, 0); +} +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; + +var title = 'browser'; +var arch = 'x64'; +var platform = 'browser'; +var env = { + PATH: '/usr/bin', + LANG: navigator.language + '.UTF-8', + PWD: '/', + HOME: '/home', + TMP: '/tmp', +}; +var argv = ['/usr/bin/node']; +var execArgv = []; +var version = 'v16.8.0'; +var versions = { node: '16.8.0' }; + +var emitWarning = function(message, type) { + console.warn((type ? (type + ': ') : '') + message); +}; + +var binding = function(name) { unimplemented('binding'); }; + +var umask = function(mask) { return 0; }; + +var cwd = function() { return '/'; }; +var chdir = function(dir) {}; + +var release = { + name: 'node', + sourceUrl: '', + headersUrl: '', + libUrl: '', +}; + +function noop() {} + +var _rawDebug = noop; +var moduleLoadList = []; +function _linkedBinding(name) { unimplemented('_linkedBinding'); } +var domain = {}; +var _exiting = false; +var config = {}; +function dlopen(name) { unimplemented('dlopen'); } +function _getActiveRequests() { return []; } +function _getActiveHandles() { return []; } +var reallyExit = noop; +var _kill = noop; +var cpuUsage = function() { return {}; }; +var resourceUsage = cpuUsage; +var memoryUsage = cpuUsage; +var kill = noop; +var exit = noop; +var openStdin = noop; +var allowedNodeEnvironmentFlags = {}; +function assert(condition, message) { + if (!condition) throw new Error(message || 'assertion error'); +} +var features = { + inspector: false, + debug: false, + uv: false, + ipv6: false, + tls_alpn: false, + tls_sni: false, + tls_ocsp: false, + tls: false, + cached_builtins: true, +}; +var _fatalExceptions = noop; +var setUncaughtExceptionCaptureCallback = noop; +function hasUncaughtExceptionCaptureCallback() { return false; }var _tickCallback = noop; +var _debugProcess = noop; +var _debugEnd = noop; +var _startProfilerIdleNotifier = noop; +var _stopProfilerIdleNotifier = noop; +var stdout = undefined; +var stderr = undefined; +var stdin = undefined; +var abort = noop; +var pid = 2; +var ppid = 1; +var execPath = '/bin/usr/node'; +var debugPort = 9229; +var argv0 = 'node'; +var _preload_modules = []; +var setSourceMapsEnabled = noop; + +var _performance = { + now: typeof performance !== 'undefined' ? performance.now.bind(performance) : undefined, + timing: typeof performance !== 'undefined' ? performance.timing : undefined, +}; +if (_performance.now === undefined) { + var nowOffset = Date.now(); + + if (_performance.timing && _performance.timing.navigationStart) { + nowOffset = _performance.timing.navigationStart; + } + _performance.now = () => Date.now() - nowOffset; +} + +function uptime() { + return _performance.now() / 1000; +} + +var nanoPerSec = 1000000000; +function hrtime(previousTimestamp) { + var baseNow = Math.floor((Date.now() - _performance.now()) * 1e-3); + var clocktime = _performance.now() * 1e-3; + var seconds = Math.floor(clocktime) + baseNow; + var nanoseconds = Math.floor((clocktime % 1) * 1e9); + if (previousTimestamp) { + seconds = seconds - previousTimestamp[0]; + nanoseconds = nanoseconds - previousTimestamp[1]; + if (nanoseconds < 0) { + seconds--; + nanoseconds += nanoPerSec; + } + } + return [seconds, nanoseconds]; +}hrtime.bigint = function(time) { + var diff = hrtime(time); + if (typeof BigInt === 'undefined') { + return diff[0] * nanoPerSec + diff[1]; + } + return BigInt(diff[0] * nanoPerSec) + BigInt(diff[1]); +}; + +var _maxListeners = 10; +var _events = {}; +var _eventsCount = 0; +function on () { return process }var addListener = on; +var once = on; +var off = on; +var removeListener = on; +var removeAllListeners = on; +var emit = noop; +var prependListener = on; +var prependOnceListener = on; +function listeners (name) { return []; } +var process = { + version, + versions, + arch, + platform, + release, + _rawDebug, + moduleLoadList, + binding, + _linkedBinding, + _events, + _eventsCount, + _maxListeners, + on, + addListener, + once, + off, + removeListener, + removeAllListeners, + emit, + prependListener, + prependOnceListener, + listeners, + domain, + _exiting, + config, + dlopen, + uptime, + _getActiveRequests, + _getActiveHandles, + reallyExit, + _kill, + cpuUsage, + resourceUsage, + memoryUsage, + kill, + exit, + openStdin, + allowedNodeEnvironmentFlags, + assert, + features, + _fatalExceptions, + setUncaughtExceptionCaptureCallback, + hasUncaughtExceptionCaptureCallback, + emitWarning, + nextTick, + _tickCallback, + _debugProcess, + _debugEnd, + _startProfilerIdleNotifier, + _stopProfilerIdleNotifier, + stdout, + stdin, + stderr, + abort, + umask, + chdir, + cwd, + env, + title, + argv, + execArgv, + pid, + ppid, + execPath, + debugPort, + hrtime, + argv0, + _preload_modules, + setSourceMapsEnabled, +}; + +export { _debugEnd, _debugProcess, _events, _eventsCount, _exiting, _fatalExceptions, _getActiveHandles, _getActiveRequests, _kill, _linkedBinding, _maxListeners, _preload_modules, _rawDebug, _startProfilerIdleNotifier, _stopProfilerIdleNotifier, _tickCallback, abort, addListener, allowedNodeEnvironmentFlags, arch, argv, argv0, assert, binding, chdir, config, cpuUsage, cwd, debugPort, process as default, dlopen, domain, emit, emitWarning, env, execArgv, execPath, exit, features, hasUncaughtExceptionCaptureCallback, hrtime, kill, listeners, memoryUsage, moduleLoadList, nextTick, off, on, once, openStdin, pid, platform, ppid, prependListener, prependOnceListener, reallyExit, release, removeAllListeners, removeListener, resourceUsage, setSourceMapsEnabled, setUncaughtExceptionCaptureCallback, stderr, stdin, stdout, title, umask, uptime, version, versions }; + +//# sourceMappingURL=process.map \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2.0.0-beta_2b28d9456b8c8ef4d6fb.8_nodelibs_os b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2.0.0-beta_1620e8f9e144fe702a06.11_nodelibs_os similarity index 65% rename from examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2.0.0-beta_2b28d9456b8c8ef4d6fb.8_nodelibs_os rename to examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2.0.0-beta_1620e8f9e144fe702a06.11_nodelibs_os index a1ed1ea46ac..65ca57a8711 100644 --- a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2.0.0-beta_2b28d9456b8c8ef4d6fb.8_nodelibs_os +++ b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2.0.0-beta_1620e8f9e144fe702a06.11_nodelibs_os @@ -1,3 +1,6 @@ +import { uptime } from './process'; +export { uptime } from './process'; + var exports = {}, _dewExec = false; function dew() { @@ -73,25 +76,38 @@ function dew() { var os = dew(); -var EOL = os.EOL; -var arch = os.arch; -var cpus = os.cpus; -var endianness = os.endianness; -var freemem = os.freemem; -var getNetworkInterfaces = os.getNetworkInterfaces; -var homedir = os.homedir; -var hostname = os.hostname; -var loadavg = os.loadavg; -var networkInterfaces = os.networkInterfaces; -var platform = os.platform; -var release = os.release; -var tmpDir = os.tmpDir; -var tmpdir = os.tmpdir; -var totalmem = os.totalmem; +var _endianness = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1 ? 'LE' : 'BE'; +os.endianness = function() { return _endianness; }; +os.homedir = function() { return '/home'; }; +os.version = function() { return ''; }; +os.arch = function() { return 'x64'; }; +os.totalmem = function() { + return navigator.deviceMemory !== undefined ? navigator.deviceMemory * (1 << 30) : 2 * (1 << 30); +}; +os.cpus = function () { + return Array(navigator.hardwareConcurrency || 0).fill({ model: '', times: {} }); +}; +os.uptime = uptime; +os.constants = {}; +var version = os.version; +var constants = os.constants; +var EOL = os.EOL; +var arch = os.arch; +var cpus = os.cpus; +var endianness = os.endianness; +var freemem = os.freemem; +var getNetworkInterfaces = os.getNetworkInterfaces; +var homedir = os.homedir; +var hostname = os.hostname; +var loadavg = os.loadavg; +var networkInterfaces = os.networkInterfaces; +var platform = os.platform; +var release = os.release; +var tmpDir = os.tmpDir; +var tmpdir = os.tmpdir; +var totalmem = os.totalmem; var type = os.type; -var uptime = os.uptime; -export default os; -export { EOL, arch, cpus, endianness, freemem, getNetworkInterfaces, homedir, hostname, loadavg, networkInterfaces, platform, release, tmpDir, tmpdir, totalmem, type, uptime }; +export { EOL, arch, constants, cpus, os as default, endianness, freemem, getNetworkInterfaces, homedir, hostname, loadavg, networkInterfaces, platform, release, tmpDir, tmpdir, totalmem, type, version }; //# sourceMappingURL=os.map \ No newline at end of file diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2_nodelibs_os_3fe9447e10c5fed754bb b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2_nodelibs_os_3fe9447e10c5fed754bb new file mode 100644 index 00000000000..4accb6487ef --- /dev/null +++ b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2_nodelibs_os_3fe9447e10c5fed754bb @@ -0,0 +1,3 @@ +import "/npm:@jspm/core@2.0.0-beta.11/nodelibs/process"; +export * from "/npm:@jspm/core@2.0.0-beta.11/nodelibs/os"; +export { default } from "/npm:@jspm/core@2.0.0-beta.11/nodelibs/os"; diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2_nodelibs_os_cf88df9df31061bcb921 b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2_nodelibs_os_cf88df9df31061bcb921 deleted file mode 100644 index 69dc15e2fba..00000000000 --- a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_jspm_core_2_nodelibs_os_cf88df9df31061bcb921 +++ /dev/null @@ -1,2 +0,0 @@ -export * from "/npm:@jspm/core@2.0.0-beta.8/nodelibs/os"; -export { default } from "/npm:@jspm/core@2.0.0-beta.8/nodelibs/os"; diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/npm_p-map_5.1_bd0dfdcf7f62202ed19e.0 b/examples/build-http/webpack.lock.data/https_jspm.dev/npm_p-map_5.1_9895e1a83d37d06ab277.0 similarity index 100% rename from examples/build-http/webpack.lock.data/https_jspm.dev/npm_p-map_5.1_bd0dfdcf7f62202ed19e.0 rename to examples/build-http/webpack.lock.data/https_jspm.dev/npm_p-map_5.1_9895e1a83d37d06ab277.0 diff --git a/examples/build-http/webpack.lock.data/https_jspm.dev/p-map_6fa685460a5a6deb568e b/examples/build-http/webpack.lock.data/https_jspm.dev/p-map_875efed0b6bd20646dd2 similarity index 100% rename from examples/build-http/webpack.lock.data/https_jspm.dev/p-map_6fa685460a5a6deb568e rename to examples/build-http/webpack.lock.data/https_jspm.dev/p-map_875efed0b6bd20646dd2 diff --git a/examples/build-http/webpack.lock.data/https_unpkg.com/p-map-series_3.0.0_index_module_9660a252c7a76b957d99.js b/examples/build-http/webpack.lock.data/https_unpkg.com/p-map-series_3.0.0_index_module_cb329557880410b778cf.js similarity index 100% rename from examples/build-http/webpack.lock.data/https_unpkg.com/p-map-series_3.0.0_index_module_9660a252c7a76b957d99.js rename to examples/build-http/webpack.lock.data/https_unpkg.com/p-map-series_3.0.0_index_module_cb329557880410b778cf.js diff --git a/examples/chunkhash/README.md b/examples/chunkhash/README.md index a18d19a83df..3527107f0d5 100644 --- a/examples/chunkhash/README.md +++ b/examples/chunkhash/README.md @@ -43,7 +43,7 @@ module.exports = { @@ -69,8 +69,9 @@ module.exports = { /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -89,13 +90,42 @@ module.exports = { /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = __webpack_modules__; /******/ -/******/ // the startup function -/******/ // It's empty as some runtime module handles the default behavior -/******/ __webpack_require__.x = x => {} /************************************************************************/ +/******/ /* webpack/runtime/chunk loaded */ +/******/ (() => { +/******/ var deferred = []; +/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { +/******/ if(chunkIds) { +/******/ priority = priority || 0; +/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; +/******/ deferred[i] = [chunkIds, fn, priority]; +/******/ return; +/******/ } +/******/ var notFulfilled = Infinity; +/******/ for (var i = 0; i < deferred.length; i++) { +/******/ var [chunkIds, fn, priority] = deferred[i]; +/******/ var fulfilled = true; +/******/ for (var j = 0; j < chunkIds.length; j++) { +/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { +/******/ chunkIds.splice(j--, 1); +/******/ } else { +/******/ fulfilled = false; +/******/ if(priority < notFulfilled) notFulfilled = priority; +/******/ } +/******/ } +/******/ if(fulfilled) { +/******/ deferred.splice(i--, 1) +/******/ var r = fn(); +/******/ if (r !== undefined) result = r; +/******/ } +/******/ } +/******/ return result; +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/create fake namespace object */ /******/ (() => { -/******/ var getProto = Object.getPrototypeOf ? (obj) => Object.getPrototypeOf(obj) : (obj) => obj.__proto__; +/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); /******/ var leafPrototypes; /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it @@ -115,9 +145,9 @@ module.exports = { /******/ var def = {}; /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { -/******/ Object.getOwnPropertyNames(current).forEach(key => def[key] = () => value[key]); +/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); /******/ } -/******/ def['default'] = () => value; +/******/ def['default'] = () => (value); /******/ __webpack_require__.d(ns, def); /******/ return ns; /******/ }; @@ -159,7 +189,7 @@ module.exports = { /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ @@ -167,7 +197,7 @@ module.exports = { /******/ 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) => { +/******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { @@ -197,7 +227,7 @@ module.exports = { /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); -/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ ; @@ -230,14 +260,11 @@ module.exports = { /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 1: 0 /******/ }; /******/ -/******/ var deferredModules = [ -/******/ -/******/ ]; /******/ __webpack_require__.f.j = (chunkId, promises) => { /******/ // JSONP chunk loading for javascript /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; @@ -247,11 +274,9 @@ module.exports = { /******/ if(installedChunkData) { /******/ promises.push(installedChunkData[2]); /******/ } else { -/******/ if(true) { // all chunks have JS +/******/ if(1 != chunkId) { /******/ // setup Promise in chunk cache -/******/ var promise = new Promise((resolve, reject) => { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading @@ -273,7 +298,7 @@ module.exports = { /******/ } /******/ } /******/ }; -/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -287,69 +312,36 @@ module.exports = { /******/ /******/ // no HMR manifest /******/ -/******/ var checkDeferredModules = x => {}; +/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { -/******/ var [chunkIds, moreModules, runtime, executeModules] = 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); +/******/ installedChunks[chunkId][0](); /******/ } -/******/ installedChunks[chunkId] = 0; +/******/ installedChunks[chunkIds[i]] = 0; /******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); -/******/ } -/******/ -/******/ // add entry modules from loaded chunk to deferred list -/******/ if(executeModules) deferredModules.push.apply(deferredModules, executeModules); -/******/ -/******/ // run deferred modules when all chunks ready -/******/ return checkDeferredModules(); +/******/ return __webpack_require__.O(result); /******/ } /******/ /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ function checkDeferredModulesImpl() { -/******/ var result; -/******/ for(var i = 0; i < deferredModules.length; i++) { -/******/ var deferredModule = deferredModules[i]; -/******/ var fulfilled = true; -/******/ for(var j = 1; j < deferredModule.length; j++) { -/******/ var depId = deferredModule[j]; -/******/ if(installedChunks[depId] !== 0) fulfilled = false; -/******/ } -/******/ if(fulfilled) { -/******/ deferredModules.splice(i--, 1); -/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]); -/******/ } -/******/ } -/******/ if(deferredModules.length === 0) { -/******/ __webpack_require__.x(); -/******/ __webpack_require__.x = x => {}; -/******/ } -/******/ return result; -/******/ } -/******/ var startup = __webpack_require__.x; -/******/ __webpack_require__.x = () => { -/******/ // reset startup function so it can be called again when more startup code is added -/******/ __webpack_require__.x = startup || (x => {}); -/******/ return (checkDeferredModules = checkDeferredModulesImpl)(); -/******/ }; /******/ })(); /******/ /************************************************************************/ @@ -358,8 +350,8 @@ module.exports = { ``` js -/******/ // run startup -/******/ return __webpack_require__.x(); +/******/ +/******/ /******/ })() ; ``` @@ -383,7 +375,11 @@ __webpack_require__.e(/*! import() */ 3).then(__webpack_require__.t.bind(__webpa /***/ }) ], -0,[[0,1]]]); +/******/ __webpack_require__ => { // webpackRuntimeModules +/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) +/******/ var __webpack_exports__ = (__webpack_exec__(0)); +/******/ } +]); ``` # Info @@ -391,19 +387,19 @@ __webpack_require__.e(/*! import() */ 3).then(__webpack_require__.t.bind(__webpa ## Unoptimized ``` -asset runtime~main.[chunkhash].js 12.5 KiB [emitted] (name: runtime~main) -asset main.[chunkhash].js 652 bytes [emitted] (name: main) +asset runtime~main.[chunkhash].js 12.2 KiB [emitted] (name: runtime~main) +asset main.[chunkhash].js 873 bytes [emitted] (name: main) asset 2.[chunkhash].js 285 bytes [emitted] asset 3.[chunkhash].js 279 bytes [emitted] -Entrypoint main 13.1 KiB = runtime~main.[chunkhash].js 12.5 KiB main.[chunkhash].js 652 bytes +Entrypoint main 13 KiB = runtime~main.[chunkhash].js 12.2 KiB main.[chunkhash].js 873 bytes chunk (runtime: runtime~main) main.[chunkhash].js (main) 55 bytes [initial] [rendered] > ./example main ./example.js 55 bytes [built] [code generated] [used exports unknown] entry ./example main -chunk (runtime: runtime~main) runtime~main.[chunkhash].js (runtime~main) 7.7 KiB [entry] [rendered] +chunk (runtime: runtime~main) runtime~main.[chunkhash].js (runtime~main) 7.6 KiB [entry] [rendered] > ./example main - runtime modules 7.7 KiB 9 modules + runtime modules 7.6 KiB 10 modules chunk (runtime: runtime~main) 2.[chunkhash].js 28 bytes [rendered] > ./async1 ./example.js 2:0-18 ./async1.js 28 bytes [built] [code generated] @@ -414,17 +410,17 @@ chunk (runtime: runtime~main) 3.[chunkhash].js 28 bytes [rendered] ./async2.js 28 bytes [built] [code generated] [used exports unknown] import() ./async2 ./example.js 3:0-18 -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset runtime~main.[chunkhash].js 2.63 KiB [emitted] [minimized] (name: runtime~main) -asset main.[chunkhash].js 155 bytes [emitted] [minimized] (name: main) +asset runtime~main.[chunkhash].js 2.73 KiB [emitted] [minimized] (name: runtime~main) +asset main.[chunkhash].js 157 bytes [emitted] [minimized] (name: main) asset 114.[chunkhash].js 69 bytes [emitted] [minimized] asset 172.[chunkhash].js 69 bytes [emitted] [minimized] -Entrypoint main 2.78 KiB = runtime~main.[chunkhash].js 2.63 KiB main.[chunkhash].js 155 bytes +Entrypoint main 2.89 KiB = runtime~main.[chunkhash].js 2.73 KiB main.[chunkhash].js 157 bytes chunk (runtime: runtime~main) 114.[chunkhash].js 28 bytes [rendered] > ./async1 ./example.js 2:0-18 ./async1.js 28 bytes [built] [code generated] @@ -440,8 +436,8 @@ chunk (runtime: runtime~main) main.[chunkhash].js (main) 55 bytes [initial] [ren ./example.js 55 bytes [built] [code generated] [no exports used] entry ./example main -chunk (runtime: runtime~main) runtime~main.[chunkhash].js (runtime~main) 7.7 KiB [entry] [rendered] +chunk (runtime: runtime~main) runtime~main.[chunkhash].js (runtime~main) 7.6 KiB [entry] [rendered] > ./example main - runtime modules 7.7 KiB 9 modules -webpack 5.11.1 compiled successfully + runtime modules 7.6 KiB 10 modules +webpack 5.51.1 compiled successfully ``` diff --git a/examples/cjs-tree-shaking/README.md b/examples/cjs-tree-shaking/README.md index 99aac42c798..1a67c5a0604 100644 --- a/examples/cjs-tree-shaking/README.md +++ b/examples/cjs-tree-shaking/README.md @@ -126,8 +126,9 @@ __webpack_unused_export__ = function multiply() { /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -149,6 +150,8 @@ __webpack_unused_export__ = function multiply() { ``` js +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { /*!********************!*\ !*** ./example.js ***! @@ -169,14 +172,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 o=t(2).I;n.nP=function(r){return o(r,1)}},(r,n)=>{n.I=function(){for(var r=0,n=0,t=arguments,o=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 dependent modules 564 bytes [dependent] 2 modules ./example.js 70 bytes [built] [code generated] [no exports used] entry ./example.js main -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully -asset without.js 2.91 KiB [emitted] (name: main) +asset without.js 3.08 KiB [emitted] (name: main) chunk (runtime: main) 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.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset output.js 351 bytes [emitted] [minimized] (name: main) 1 related asset +asset output.js 365 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.11.1 compiled successfully +webpack 5.51.1 compiled successfully -asset without.js 537 bytes [emitted] [minimized] (name: main) 1 related asset +asset without.js 551 bytes [emitted] [minimized] (name: main) 1 related asset chunk (runtime: main) 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.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/code-splitted-require.context-amd/README.md b/examples/code-splitted-require.context-amd/README.md index 0645f2375a2..8c3c8b6e2f1 100644 --- a/examples/code-splitted-require.context-amd/README.md +++ b/examples/code-splitted-require.context-amd/README.md @@ -31,8 +31,9 @@ getTemplate("b", function(b) { /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -76,7 +77,7 @@ getTemplate("b", function(b) { /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ @@ -84,7 +85,7 @@ getTemplate("b", function(b) { /******/ 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) => { +/******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { @@ -114,7 +115,7 @@ getTemplate("b", function(b) { /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); -/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ ; @@ -136,12 +137,11 @@ getTemplate("b", function(b) { /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 179: 0 /******/ }; /******/ -/******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { /******/ // JSONP chunk loading for javascript /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; @@ -153,9 +153,7 @@ getTemplate("b", function(b) { /******/ } else { /******/ if(true) { // all chunks have JS /******/ // setup Promise in chunk cache -/******/ var promise = new Promise((resolve, reject) => { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading @@ -177,7 +175,7 @@ getTemplate("b", function(b) { /******/ } /******/ } /******/ }; -/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -191,30 +189,29 @@ getTemplate("b", function(b) { /******/ /******/ // no HMR manifest /******/ -/******/ // no deferred startup +/******/ // no on chunks loaded /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); +/******/ installedChunks[chunkId][0](); /******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); +/******/ installedChunks[chunkIds[i]] = 0; /******/ } /******/ /******/ } @@ -222,8 +219,6 @@ getTemplate("b", function(b) { /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ // no deferred startup /******/ })(); /******/ /************************************************************************/ @@ -232,6 +227,7 @@ getTemplate("b", function(b) { ``` js +var __webpack_exports__ = {}; /*!********************!*\ !*** ./example.js ***! \********************/ @@ -346,11 +342,11 @@ module.exports = function() { ## Unoptimized ``` -asset output.js 9.04 KiB [emitted] (name: main) +asset output.js 9.05 KiB [emitted] (name: main) asset 577.output.js 2.23 KiB [emitted] -chunk (runtime: main) output.js (main) 251 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 251 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules ./example.js 251 bytes [built] [code generated] [used exports unknown] entry ./example.js main @@ -361,7 +357,7 @@ chunk (runtime: main) 577.output.js 457 bytes [rendered] [no exports] [used exports unknown] amd require context ./example.js 2:1-4:3 -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode @@ -369,9 +365,9 @@ webpack 5.11.1 compiled successfully ``` asset output.js 1.82 KiB [emitted] [minimized] (name: main) asset 577.output.js 609 bytes [emitted] [minimized] -chunk (runtime: main) output.js (main) 251 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 251 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules ./example.js 251 bytes [built] [code generated] [no exports used] entry ./example.js main @@ -381,5 +377,5 @@ chunk (runtime: main) 577.output.js 457 bytes [rendered] ../require.context/templates/ sync ^\.\/.*$ 217 bytes [built] [code generated] [no exports] amd require context ./example.js 2:1-4:3 -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/code-splitted-require.context/README.md b/examples/code-splitted-require.context/README.md index 1073a2b087d..400ad77b9d4 100644 --- a/examples/code-splitted-require.context/README.md +++ b/examples/code-splitted-require.context/README.md @@ -31,8 +31,9 @@ getTemplate("b", function(b) { /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -76,7 +77,7 @@ getTemplate("b", function(b) { /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ @@ -84,7 +85,7 @@ getTemplate("b", function(b) { /******/ 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) => { +/******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { @@ -114,7 +115,7 @@ getTemplate("b", function(b) { /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); -/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ ; @@ -136,12 +137,11 @@ getTemplate("b", function(b) { /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 179: 0 /******/ }; /******/ -/******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { /******/ // JSONP chunk loading for javascript /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; @@ -153,9 +153,7 @@ getTemplate("b", function(b) { /******/ } else { /******/ if(true) { // all chunks have JS /******/ // setup Promise in chunk cache -/******/ var promise = new Promise((resolve, reject) => { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading @@ -177,7 +175,7 @@ getTemplate("b", function(b) { /******/ } /******/ } /******/ }; -/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -191,30 +189,29 @@ getTemplate("b", function(b) { /******/ /******/ // no HMR manifest /******/ -/******/ // no deferred startup +/******/ // no on chunks loaded /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); +/******/ installedChunks[chunkId][0](); /******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); +/******/ installedChunks[chunkIds[i]] = 0; /******/ } /******/ /******/ } @@ -222,8 +219,6 @@ getTemplate("b", function(b) { /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ // no deferred startup /******/ })(); /******/ /************************************************************************/ @@ -232,6 +227,7 @@ getTemplate("b", function(b) { ``` js +var __webpack_exports__ = {}; /*!********************!*\ !*** ./example.js ***! \********************/ @@ -348,9 +344,9 @@ module.exports = function() { ``` asset output.js 8.96 KiB [emitted] (name: main) asset 577.output.js 2.23 KiB [emitted] -chunk (runtime: main) output.js (main) 266 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 266 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules ./example.js 266 bytes [built] [code generated] [used exports unknown] entry ./example.js main @@ -361,17 +357,17 @@ chunk (runtime: main) 577.output.js 457 bytes [rendered] [no exports] [used exports unknown] cjs require context ./example.js 3:11-64 -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset output.js 1.79 KiB [emitted] [minimized] (name: main) +asset output.js 1.8 KiB [emitted] [minimized] (name: main) asset 577.output.js 609 bytes [emitted] [minimized] -chunk (runtime: main) output.js (main) 266 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 266 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules ./example.js 266 bytes [built] [code generated] [no exports used] entry ./example.js main @@ -381,5 +377,5 @@ chunk (runtime: main) 577.output.js 457 bytes [rendered] ../require.context/templates/ sync ^\.\/.*$ 217 bytes [built] [code generated] [no exports] cjs require context ./example.js 3:11-64 -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/code-splitting-bundle-loader/README.md b/examples/code-splitting-bundle-loader/README.md index 25c3fe5aed7..cd6d8e87bb4 100644 --- a/examples/code-splitting-bundle-loader/README.md +++ b/examples/code-splitting-bundle-loader/README.md @@ -60,8 +60,9 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -105,7 +106,7 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ @@ -113,7 +114,7 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ 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) => { +/******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { @@ -143,7 +144,7 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); -/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ ; @@ -165,12 +166,11 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 179: 0 /******/ }; /******/ -/******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { /******/ // JSONP chunk loading for javascript /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; @@ -182,9 +182,7 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ } else { /******/ if(true) { // all chunks have JS /******/ // setup Promise in chunk cache -/******/ var promise = new Promise((resolve, reject) => { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading @@ -206,7 +204,7 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ } /******/ } /******/ }; -/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -220,30 +218,29 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ /******/ // no HMR manifest /******/ -/******/ // no deferred startup +/******/ // no on chunks loaded /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); +/******/ installedChunks[chunkId][0](); /******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); +/******/ installedChunks[chunkIds[i]] = 0; /******/ } /******/ /******/ } @@ -251,8 +248,6 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ // no deferred startup /******/ })(); /******/ /************************************************************************/ @@ -261,6 +256,8 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) { ``` js +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { /*!********************!*\ !*** ./example.js ***! @@ -303,11 +300,11 @@ module.exports = "It works"; ## Unoptimized ``` -asset output.js 9.58 KiB [emitted] (name: main) +asset output.js 9.7 KiB [emitted] (name: main) asset 929.output.js 354 bytes [emitted] -chunk (runtime: main) output.js (main) 375 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 375 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules dependent modules 281 bytes [dependent] 1 module ./example.js 94 bytes [built] [code generated] [used exports unknown] @@ -318,17 +315,17 @@ chunk (runtime: main) 929.output.js 28 bytes [rendered] [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.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset output.js 1.84 KiB [emitted] [minimized] (name: main) +asset output.js 1.85 KiB [emitted] [minimized] (name: main) asset 929.output.js 88 bytes [emitted] [minimized] -chunk (runtime: main) output.js (main) 375 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 375 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules dependent modules 281 bytes [dependent] 1 module ./example.js 94 bytes [built] [code generated] [no exports used] @@ -339,5 +336,5 @@ chunk (runtime: main) 929.output.js 28 bytes [rendered] [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.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/code-splitting-depend-on-advanced/README.md b/examples/code-splitting-depend-on-advanced/README.md index 66766b04e01..f0a1b82b235 100644 --- a/examples/code-splitting-depend-on-advanced/README.md +++ b/examples/code-splitting-depend-on-advanced/README.md @@ -79,8 +79,9 @@ console.log(lodash, isomorphicFetch); /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -99,17 +100,46 @@ console.log(lodash, isomorphicFetch); /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = __webpack_modules__; /******/ -/******/ // the startup function -/******/ // It's empty as some runtime module handles the default behavior -/******/ __webpack_require__.x = x => {} /************************************************************************/ +/******/ /* webpack/runtime/chunk loaded */ +/******/ (() => { +/******/ var deferred = []; +/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { +/******/ if(chunkIds) { +/******/ priority = priority || 0; +/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; +/******/ deferred[i] = [chunkIds, fn, priority]; +/******/ return; +/******/ } +/******/ var notFulfilled = Infinity; +/******/ for (var i = 0; i < deferred.length; i++) { +/******/ var [chunkIds, fn, priority] = deferred[i]; +/******/ var fulfilled = true; +/******/ for (var j = 0; j < chunkIds.length; j++) { +/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { +/******/ chunkIds.splice(j--, 1); +/******/ } else { +/******/ fulfilled = false; +/******/ if(priority < notFulfilled) notFulfilled = priority; +/******/ } +/******/ } +/******/ if(fulfilled) { +/******/ deferred.splice(i--, 1) +/******/ var r = fn(); +/******/ if (r !== undefined) result = r; +/******/ } +/******/ } +/******/ return result; +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? -/******/ () => module['default'] : -/******/ () => module; +/******/ () => (module['default']) : +/******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; @@ -151,7 +181,7 @@ console.log(lodash, isomorphicFetch); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ @@ -159,7 +189,7 @@ console.log(lodash, isomorphicFetch); /******/ 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) => { +/******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { @@ -189,7 +219,7 @@ console.log(lodash, isomorphicFetch); /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); -/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ ; @@ -222,14 +252,11 @@ console.log(lodash, isomorphicFetch); /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ "runtime": 0 /******/ }; /******/ -/******/ var deferredModules = [ -/******/ -/******/ ]; /******/ __webpack_require__.f.j = (chunkId, promises) => { /******/ // JSONP chunk loading for javascript /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; @@ -239,11 +266,9 @@ console.log(lodash, isomorphicFetch); /******/ if(installedChunkData) { /******/ promises.push(installedChunkData[2]); /******/ } else { -/******/ if(true) { // all chunks have JS +/******/ if("runtime" != chunkId) { /******/ // setup Promise in chunk cache -/******/ var promise = new Promise((resolve, reject) => { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading @@ -265,7 +290,7 @@ console.log(lodash, isomorphicFetch); /******/ } /******/ } /******/ }; -/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -279,69 +304,36 @@ console.log(lodash, isomorphicFetch); /******/ /******/ // no HMR manifest /******/ -/******/ var checkDeferredModules = x => {}; +/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { -/******/ var [chunkIds, moreModules, runtime, executeModules] = 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); -/******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ installedChunks[chunkId][0](); /******/ } +/******/ installedChunks[chunkIds[i]] = 0; /******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); -/******/ } -/******/ -/******/ // add entry modules from loaded chunk to deferred list -/******/ if(executeModules) deferredModules.push.apply(deferredModules, executeModules); -/******/ -/******/ // run deferred modules when all chunks ready -/******/ return checkDeferredModules(); +/******/ return __webpack_require__.O(result); /******/ } /******/ /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ function checkDeferredModulesImpl() { -/******/ var result; -/******/ for(var i = 0; i < deferredModules.length; i++) { -/******/ var deferredModule = deferredModules[i]; -/******/ var fulfilled = true; -/******/ for(var j = 1; j < deferredModule.length; j++) { -/******/ var depId = deferredModule[j]; -/******/ if(installedChunks[depId] !== 0) fulfilled = false; -/******/ } -/******/ if(fulfilled) { -/******/ deferredModules.splice(i--, 1); -/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]); -/******/ } -/******/ } -/******/ if(deferredModules.length === 0) { -/******/ __webpack_require__.x(); -/******/ __webpack_require__.x = x => {}; -/******/ } -/******/ return result; -/******/ } -/******/ var startup = __webpack_require__.x; -/******/ __webpack_require__.x = () => { -/******/ // reset startup function so it can be called again when more startup code is added -/******/ __webpack_require__.x = startup || (x => {}); -/******/ return (checkDeferredModules = checkDeferredModulesImpl)(); -/******/ }; /******/ })(); /******/ /************************************************************************/ @@ -350,8 +342,8 @@ console.log(lodash, isomorphicFetch); ``` js -/******/ // run startup -/******/ return __webpack_require__.x(); +/******/ +/******/ /******/ })() ; ``` @@ -359,9 +351,10 @@ console.log(lodash, isomorphicFetch); # dist/app.js ```javascript +"use strict"; (self["webpackChunk"] = self["webpackChunk"] || []).push([["app"],{ -/***/ 7: +/***/ 6: /*!****************!*\ !*** ./app.js ***! \****************/ @@ -370,7 +363,6 @@ console.log(lodash, isomorphicFetch); /*! 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__); @@ -385,15 +377,21 @@ console.log((isomorphic_fetch__WEBPACK_IMPORTED_MODULE_0___default()), (lodash__ /***/ }) }, -0,[[7,"runtime","other-vendors"]]]); +/******/ __webpack_require__ => { // webpackRuntimeModules +/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) +/******/ __webpack_require__.O(0, ["other-vendors"], () => (__webpack_exec__(6))); +/******/ var __webpack_exports__ = __webpack_require__.O(); +/******/ } +]); ``` # dist/page1.js ```javascript +"use strict"; (self["webpackChunk"] = self["webpackChunk"] || []).push([["page1"],{ -/***/ 6: +/***/ 7: /*!******************!*\ !*** ./page1.js ***! \******************/ @@ -402,7 +400,6 @@ console.log((isomorphic_fetch__WEBPACK_IMPORTED_MODULE_0___default()), (lodash__ /*! 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__); @@ -422,7 +419,12 @@ __webpack_require__.e(/*! import() */ "lazy_js").then(__webpack_require__.bind(_ /***/ }) }, -0,[[6,"app","runtime","react-vendors","other-vendors"]]]); +/******/ __webpack_require__ => { // webpackRuntimeModules +/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) +/******/ __webpack_require__.O(0, ["app","react-vendors","other-vendors"], () => (__webpack_exec__(7))); +/******/ var __webpack_exports__ = __webpack_require__.O(); +/******/ } +]); ``` # dist/other-vendors.js @@ -482,7 +484,11 @@ module.exports = "isomorphic-fetch"; /***/ }) ], -0,[[3,"runtime"]]]); +/******/ __webpack_require__ => { // webpackRuntimeModules +/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) +/******/ var __webpack_exports__ = (__webpack_exec__(3)); +/******/ } +]); ``` # dist/react-vendors.js @@ -529,7 +535,11 @@ module.exports = 'prop-types'; /***/ }) ], -0,[[0,"runtime"],[1,"runtime"],[2,"runtime"]]]); +/******/ __webpack_require__ => { // webpackRuntimeModules +/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) +/******/ var __webpack_exports__ = (__webpack_exec__(0), __webpack_exec__(1), __webpack_exec__(2)); +/******/ } +]); ``` # Info @@ -537,16 +547,16 @@ module.exports = 'prop-types'; ## Unoptimized ``` -asset runtime.js 11.4 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 runtime.js 11.1 KiB [emitted] (name: runtime) +asset other-vendors.js 2.13 KiB [emitted] (name: other-vendors) +asset page1.js 1.91 KiB [emitted] (name: page1) +asset app.js 1.44 KiB [emitted] (name: app) +asset react-vendors.js 1.33 KiB [emitted] (name: react-vendors) 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.5 KiB = runtime.js 11.4 KiB react-vendors.js 1.1 KiB -Entrypoint other-vendors 13.3 KiB = runtime.js 11.4 KiB other-vendors.js 1.92 KiB +Entrypoint app 1.44 KiB = app.js +Entrypoint page1 1.91 KiB = page1.js +Entrypoint react-vendors 12.5 KiB = runtime.js 11.1 KiB react-vendors.js 1.33 KiB +Entrypoint other-vendors 13.3 KiB = runtime.js 11.1 KiB other-vendors.js 2.13 KiB chunk (runtime: runtime) app.js (app) 116 bytes <{other-vendors}> <{runtime}> >{page1}< [initial] [rendered] > ./app.js app ./app.js 116 bytes [built] [code generated] @@ -578,44 +588,47 @@ chunk (runtime: runtime) react-vendors.js (react-vendors) 87 bytes ={runtime}= > > 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 + from origin ./lazy.js + 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] + from origin ./page1.js + harmony side effect evaluation react-dom ./page1.js 3:0-33 + harmony import specifier react-dom ./page1.js 5:36-44 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] + from origin ./page1.js + harmony side effect evaluation react ./page1.js 2:0-26 + harmony import specifier react ./page1.js 5:29-34 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.85 KiB ={other-vendors}= ={react-vendors}= >{app}< >{page1}< [entry] [rendered] +chunk (runtime: runtime) runtime.js (runtime) 6.75 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.85 KiB 9 modules -webpack 5.11.1 compiled successfully + runtime modules 6.75 KiB 10 modules +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset runtime.js 2.26 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 runtime.js 2.37 KiB [emitted] [minimized] (name: runtime) +asset page1.js 287 bytes [emitted] [minimized] (name: page1) +asset other-vendors.js 239 bytes [emitted] [minimized] (name: other-vendors) +asset app.js 207 bytes [emitted] [minimized] (name: app) +asset react-vendors.js 200 bytes [emitted] [minimized] (name: react-vendors) asset lazy_js.js 159 bytes [emitted] [minimized] -Entrypoint app 184 bytes = app.js -Entrypoint page1 264 bytes = page1.js -Entrypoint react-vendors 2.46 KiB = runtime.js 2.26 KiB react-vendors.js 208 bytes -Entrypoint other-vendors 2.5 KiB = runtime.js 2.26 KiB other-vendors.js 243 bytes +Entrypoint app 207 bytes = app.js +Entrypoint page1 287 bytes = page1.js +Entrypoint react-vendors 2.57 KiB = runtime.js 2.37 KiB react-vendors.js 200 bytes +Entrypoint other-vendors 2.6 KiB = runtime.js 2.37 KiB other-vendors.js 239 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] @@ -646,27 +659,30 @@ chunk (runtime: runtime) react-vendors.js (react-vendors) 87 bytes ={runtime}= > > 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 + from origin ./lazy.js + 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] + from origin ./page1.js + harmony side effect evaluation react-dom ./page1.js 3:0-33 + harmony import specifier react-dom ./page1.js 5:36-44 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] + from origin ./page1.js + harmony side effect evaluation react ./page1.js 2:0-26 + harmony import specifier react ./page1.js 5:29-34 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.85 KiB ={other-vendors}= ={react-vendors}= >{app}< >{page1}< [entry] [rendered] +chunk (runtime: runtime) runtime.js (runtime) 6.75 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.85 KiB 9 modules -webpack 5.11.1 compiled successfully + runtime modules 6.75 KiB 10 modules +webpack 5.51.1 compiled successfully ``` diff --git a/examples/code-splitting-depend-on-simple/README.md b/examples/code-splitting-depend-on-simple/README.md index ce39033f28e..34074dd70cb 100644 --- a/examples/code-splitting-depend-on-simple/README.md +++ b/examples/code-splitting-depend-on-simple/README.md @@ -31,6 +31,7 @@ console.log(react, reactDOM, propTypes); # dist/app.js ```javascript +"use strict"; (self["webpackChunk"] = self["webpackChunk"] || []).push([["app"],{ /***/ 3: @@ -42,7 +43,6 @@ console.log(react, reactDOM, propTypes); /*! 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__); @@ -60,7 +60,11 @@ console.log((react__WEBPACK_IMPORTED_MODULE_0___default()), (react_dom__WEBPACK_ /***/ }) }, -0,[[3,"react-vendors"]]]); +/******/ __webpack_require__ => { // webpackRuntimeModules +/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) +/******/ var __webpack_exports__ = (__webpack_exec__(3)); +/******/ } +]); ``` # dist/react-vendors.js @@ -120,8 +124,9 @@ module.exports = 'prop-types'; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -140,17 +145,46 @@ module.exports = 'prop-types'; /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = __webpack_modules__; /******/ -/******/ // the startup function -/******/ // It's empty as some runtime module handles the default behavior -/******/ __webpack_require__.x = x => {} /************************************************************************/ +/******/ /* webpack/runtime/chunk loaded */ +/******/ (() => { +/******/ var deferred = []; +/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { +/******/ if(chunkIds) { +/******/ priority = priority || 0; +/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; +/******/ deferred[i] = [chunkIds, fn, priority]; +/******/ return; +/******/ } +/******/ var notFulfilled = Infinity; +/******/ for (var i = 0; i < deferred.length; i++) { +/******/ var [chunkIds, fn, priority] = deferred[i]; +/******/ var fulfilled = true; +/******/ for (var j = 0; j < chunkIds.length; j++) { +/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { +/******/ chunkIds.splice(j--, 1); +/******/ } else { +/******/ fulfilled = false; +/******/ if(priority < notFulfilled) notFulfilled = priority; +/******/ } +/******/ } +/******/ if(fulfilled) { +/******/ deferred.splice(i--, 1) +/******/ var r = fn(); +/******/ if (r !== undefined) result = r; +/******/ } +/******/ } +/******/ return result; +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? -/******/ () => module['default'] : -/******/ () => module; +/******/ () => (module['default']) : +/******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; @@ -170,7 +204,7 @@ module.exports = 'prop-types'; /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ @@ -190,16 +224,11 @@ module.exports = 'prop-types'; /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ "react-vendors": 0 /******/ }; /******/ -/******/ var deferredModules = [ -/******/ [0], -/******/ [1], -/******/ [2] -/******/ ]; /******/ // no chunk on demand loading /******/ /******/ // no prefetching @@ -210,69 +239,36 @@ module.exports = 'prop-types'; /******/ /******/ // no HMR manifest /******/ -/******/ var checkDeferredModules = x => {}; +/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { -/******/ var [chunkIds, moreModules, runtime, executeModules] = 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); -/******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ installedChunks[chunkId][0](); /******/ } +/******/ installedChunks[chunkIds[i]] = 0; /******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); -/******/ } -/******/ -/******/ // add entry modules from loaded chunk to deferred list -/******/ if(executeModules) deferredModules.push.apply(deferredModules, executeModules); -/******/ -/******/ // run deferred modules when all chunks ready -/******/ return checkDeferredModules(); +/******/ return __webpack_require__.O(result); /******/ } /******/ /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ function checkDeferredModulesImpl() { -/******/ var result; -/******/ for(var i = 0; i < deferredModules.length; i++) { -/******/ var deferredModule = deferredModules[i]; -/******/ var fulfilled = true; -/******/ for(var j = 1; j < deferredModule.length; j++) { -/******/ var depId = deferredModule[j]; -/******/ if(installedChunks[depId] !== 0) fulfilled = false; -/******/ } -/******/ if(fulfilled) { -/******/ deferredModules.splice(i--, 1); -/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]); -/******/ } -/******/ } -/******/ if(deferredModules.length === 0) { -/******/ __webpack_require__.x(); -/******/ __webpack_require__.x = x => {}; -/******/ } -/******/ return result; -/******/ } -/******/ var startup = __webpack_require__.x; -/******/ __webpack_require__.x = () => { -/******/ // reset startup function so it can be called again when more startup code is added -/******/ __webpack_require__.x = startup || (x => {}); -/******/ return (checkDeferredModules = checkDeferredModulesImpl)(); -/******/ }; /******/ })(); /******/ /************************************************************************/ @@ -281,8 +277,15 @@ module.exports = 'prop-types'; ``` js -/******/ // run startup -/******/ return __webpack_require__.x(); +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module is referenced by other modules so it can't be inlined +/******/ __webpack_require__(0); +/******/ __webpack_require__(1); +/******/ var __webpack_exports__ = __webpack_require__(2); +/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); +/******/ /******/ })() ; ``` @@ -292,75 +295,81 @@ module.exports = 'prop-types'; ## Unoptimized ``` -asset react-vendors.js 7.56 KiB [emitted] (name: react-vendors) -asset app.js 1.43 KiB [emitted] (name: app) +asset react-vendors.js 7.62 KiB [emitted] (name: react-vendors) +asset app.js 1.63 KiB [emitted] (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] [used exports unknown] entry ./app.js app -chunk (runtime: react-vendors) react-vendors.js (react-vendors) 87 bytes (javascript) 3.42 KiB (runtime) >{app}< [entry] [rendered] +chunk (runtime: react-vendors) react-vendors.js (react-vendors) 87 bytes (javascript) 3.3 KiB (runtime) >{app}< [entry] [rendered] > prop-types react-vendors > react react-vendors > react-dom react-vendors - runtime modules 3.42 KiB 5 modules + runtime modules 3.3 KiB 6 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 + from origin ./app.js + 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 + from origin ./app.js + 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 + from origin ./app.js + 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.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset react-vendors.js 1.05 KiB [emitted] [minimized] (name: react-vendors) -asset app.js 195 bytes [emitted] [minimized] (name: app) +asset react-vendors.js 1.15 KiB [emitted] [minimized] (name: react-vendors) +asset app.js 185 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.15 KiB (runtime) >{app}< [entry] [rendered] +chunk (runtime: react-vendors) react-vendors.js (react-vendors) 87 bytes (javascript) 3.03 KiB (runtime) >{app}< [entry] [rendered] > prop-types react-vendors > react react-vendors > react-dom react-vendors - runtime modules 3.15 KiB 4 modules + runtime modules 3.03 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 + from origin ./app.js + 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 + from origin ./app.js + 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 + from origin ./app.js + 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.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/code-splitting-harmony/README.md b/examples/code-splitting-harmony/README.md index 7ffefdb5c4c..53ab39f82b2 100644 --- a/examples/code-splitting-harmony/README.md +++ b/examples/code-splitting-harmony/README.md @@ -29,35 +29,7 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) { ```javascript /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ([ -/* 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, 23)).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); -}); - - -/***/ }), +/* 0 */, /* 1 */ /*!***************************!*\ !*** ./node_modules/a.js ***! @@ -107,10 +79,10 @@ function webpackAsyncContext(req) { var ids = map[req], id = ids[0]; return __webpack_require__.e(ids[1]).then(() => { - return __webpack_require__.t(id, 7); + return __webpack_require__.t(id, 7 | 16); }); } -webpackAsyncContext.keys = () => Object.keys(map); +webpackAsyncContext.keys = () => (Object.keys(map)); webpackAsyncContext.id = 2; module.exports = webpackAsyncContext; @@ -128,8 +100,9 @@ module.exports = webpackAsyncContext; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -154,8 +127,8 @@ module.exports = webpackAsyncContext; /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? -/******/ () => module['default'] : -/******/ () => module; +/******/ () => (module['default']) : +/******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; @@ -163,7 +136,7 @@ module.exports = webpackAsyncContext; /******/ /******/ /* webpack/runtime/create fake namespace object */ /******/ (() => { -/******/ var getProto = Object.getPrototypeOf ? (obj) => Object.getPrototypeOf(obj) : (obj) => obj.__proto__; +/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); /******/ var leafPrototypes; /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it @@ -183,9 +156,9 @@ module.exports = webpackAsyncContext; /******/ var def = {}; /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { -/******/ Object.getOwnPropertyNames(current).forEach(key => def[key] = () => value[key]); +/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); /******/ } -/******/ def['default'] = () => value; +/******/ def['default'] = () => (value); /******/ __webpack_require__.d(ns, def); /******/ return ns; /******/ }; @@ -227,7 +200,7 @@ module.exports = webpackAsyncContext; /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ @@ -235,7 +208,7 @@ module.exports = webpackAsyncContext; /******/ 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) => { +/******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { @@ -265,7 +238,7 @@ module.exports = webpackAsyncContext; /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); -/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ ; @@ -298,12 +271,11 @@ module.exports = webpackAsyncContext; /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 179: 0 /******/ }; /******/ -/******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { /******/ // JSONP chunk loading for javascript /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; @@ -315,9 +287,7 @@ module.exports = webpackAsyncContext; /******/ } else { /******/ if(true) { // all chunks have JS /******/ // setup Promise in chunk cache -/******/ var promise = new Promise((resolve, reject) => { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading @@ -339,7 +309,7 @@ module.exports = webpackAsyncContext; /******/ } /******/ } /******/ }; -/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -353,30 +323,29 @@ module.exports = webpackAsyncContext; /******/ /******/ // no HMR manifest /******/ -/******/ // no deferred startup +/******/ // no on chunks loaded /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); -/******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ installedChunks[chunkId][0](); /******/ } -/******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); +/******/ installedChunks[chunkIds[i]] = 0; /******/ } /******/ /******/ } @@ -384,8 +353,6 @@ module.exports = webpackAsyncContext; /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ // no deferred startup /******/ })(); /******/ /************************************************************************/ @@ -394,10 +361,35 @@ module.exports = webpackAsyncContext; ``` js -/******/ // startup -/******/ // Load entry module -/******/ __webpack_require__(0); -/******/ // This entry module used 'exports' so it can't be inlined +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +(() => { +"use strict"; +/*!********************!*\ + !*** ./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__.* */ +__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, 23)).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); +}); + +})(); + /******/ })() ; ``` @@ -407,7 +399,7 @@ module.exports = webpackAsyncContext; ## Unoptimized ``` -asset output.js 13.7 KiB [emitted] (name: main) +asset output.js 13.6 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] @@ -416,11 +408,11 @@ chunk (runtime: main) 98.output.js 13 bytes [rendered] > ./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.9 KiB (runtime) [entry] [rendered] + import() context element ./2 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2 + import() context element ./2.js ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2.js +chunk (runtime: main) output.js (main) 414 bytes (javascript) 6.92 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 6.9 KiB 10 modules + runtime modules 6.92 KiB 10 modules dependent modules 171 bytes [dependent] 2 modules ./example.js 243 bytes [built] [code generated] [no exports] @@ -431,14 +423,14 @@ chunk (runtime: main) 346.output.js 13 bytes [rendered] > ./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 + import() context element ./1 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./1 + import() 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.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode @@ -453,11 +445,11 @@ chunk (runtime: main) 98.output.js 13 bytes [rendered] > ./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) 403 bytes (javascript) 6.64 KiB (runtime) [entry] [rendered] + import() context element ./2 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2 + import() context element ./2.js ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2.js +chunk (runtime: main) output.js (main) 403 bytes (javascript) 6.66 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 6.64 KiB 9 modules + runtime modules 6.66 KiB 9 modules dependent modules 160 bytes [dependent] 1 module ./example.js 243 bytes [built] [code generated] [no exports] @@ -468,12 +460,12 @@ chunk (runtime: main) 346.output.js 13 bytes [rendered] > ./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 + import() context element ./1 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./1 + import() 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.11.1 compiled successfully +webpack 5.51.1 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 05287021f41..83dd98ef47e 100644 --- a/examples/code-splitting-native-import-context-filter/README.md +++ b/examples/code-splitting-native-import-context-filter/README.md @@ -98,7 +98,7 @@ function webpackAsyncContext(req) { return __webpack_require__(id); }); } -webpackAsyncContext.keys = () => Object.keys(map); +webpackAsyncContext.keys = () => (Object.keys(map)); webpackAsyncContext.id = 1; module.exports = webpackAsyncContext; @@ -116,8 +116,9 @@ module.exports = webpackAsyncContext; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -173,7 +174,7 @@ module.exports = webpackAsyncContext; /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ @@ -181,7 +182,7 @@ module.exports = webpackAsyncContext; /******/ 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) => { +/******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { @@ -211,7 +212,7 @@ module.exports = webpackAsyncContext; /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); -/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ ; @@ -244,12 +245,11 @@ module.exports = webpackAsyncContext; /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 179: 0 /******/ }; /******/ -/******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { /******/ // JSONP chunk loading for javascript /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; @@ -261,9 +261,7 @@ module.exports = webpackAsyncContext; /******/ } else { /******/ if(true) { // all chunks have JS /******/ // setup Promise in chunk cache -/******/ var promise = new Promise((resolve, reject) => { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading @@ -285,7 +283,7 @@ module.exports = webpackAsyncContext; /******/ } /******/ } /******/ }; -/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -299,30 +297,29 @@ module.exports = webpackAsyncContext; /******/ /******/ // no HMR manifest /******/ -/******/ // no deferred startup +/******/ // no on chunks loaded /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); +/******/ installedChunks[chunkId][0](); /******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); +/******/ installedChunks[chunkIds[i]] = 0; /******/ } /******/ /******/ } @@ -330,8 +327,6 @@ module.exports = webpackAsyncContext; /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ // no deferred startup /******/ })(); /******/ /************************************************************************/ @@ -340,6 +335,8 @@ module.exports = webpackAsyncContext; ``` js +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { /*!********************!*\ !*** ./example.js ***! @@ -375,10 +372,10 @@ getTemplate("baz.noimport"); ## Unoptimized ``` -asset output.js 11.1 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] +asset output.js 11.2 KiB [emitted] (name: main) +asset 398.output.js 858 bytes [emitted] +asset 544.output.js 858 bytes [emitted] +asset 718.output.js 858 bytes [emitted] chunk (runtime: main) output.js (main) 597 bytes (javascript) 5.54 KiB (runtime) [entry] [rendered] > ./example.js main runtime modules 5.54 KiB 8 modules @@ -392,31 +389,31 @@ chunk (runtime: main) 398.output.js 38 bytes [rendered] ./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 + import() context element ./bar ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar + import() 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] [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 + import() context element ./baz ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz + import() 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] [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.11.1 compiled successfully + import() context element ./foo ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo + import() context element ./foo.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset output.js 2.47 KiB [emitted] [minimized] (name: main) +asset output.js 2.48 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] @@ -432,21 +429,21 @@ chunk (runtime: main) 398.output.js 38 bytes [rendered] > ./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 + import() context element ./bar ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./bar + import() 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 + import() context element ./baz ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./baz + import() 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.11.1 compiled successfully + import() context element ./foo ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo + import() context element ./foo.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js +webpack 5.51.1 compiled successfully ``` diff --git a/examples/code-splitting-native-import-context/README.md b/examples/code-splitting-native-import-context/README.md index e530c9b9dd0..77906615fb7 100644 --- a/examples/code-splitting-native-import-context/README.md +++ b/examples/code-splitting-native-import-context/README.md @@ -87,7 +87,7 @@ function webpackAsyncContext(req) { return __webpack_require__(id); }); } -webpackAsyncContext.keys = () => Object.keys(map); +webpackAsyncContext.keys = () => (Object.keys(map)); webpackAsyncContext.id = 1; module.exports = webpackAsyncContext; @@ -105,8 +105,9 @@ module.exports = webpackAsyncContext; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -162,7 +163,7 @@ module.exports = webpackAsyncContext; /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ @@ -170,7 +171,7 @@ module.exports = webpackAsyncContext; /******/ 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) => { +/******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { @@ -200,7 +201,7 @@ module.exports = webpackAsyncContext; /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); -/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ ; @@ -233,12 +234,11 @@ module.exports = webpackAsyncContext; /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 179: 0 /******/ }; /******/ -/******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { /******/ // JSONP chunk loading for javascript /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; @@ -250,9 +250,7 @@ module.exports = webpackAsyncContext; /******/ } else { /******/ if(true) { // all chunks have JS /******/ // setup Promise in chunk cache -/******/ var promise = new Promise((resolve, reject) => { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading @@ -274,7 +272,7 @@ module.exports = webpackAsyncContext; /******/ } /******/ } /******/ }; -/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -288,30 +286,29 @@ module.exports = webpackAsyncContext; /******/ /******/ // no HMR manifest /******/ -/******/ // no deferred startup +/******/ // no on chunks loaded /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); +/******/ installedChunks[chunkId][0](); /******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); +/******/ installedChunks[chunkIds[i]] = 0; /******/ } /******/ /******/ } @@ -319,8 +316,6 @@ module.exports = webpackAsyncContext; /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ // no deferred startup /******/ })(); /******/ /************************************************************************/ @@ -329,6 +324,8 @@ module.exports = webpackAsyncContext; ``` js +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { /*!********************!*\ !*** ./example.js ***! @@ -362,10 +359,10 @@ getTemplate("baz"); ## Unoptimized ``` -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] +asset output.js 11 KiB [emitted] (name: main) +asset 398.output.js 858 bytes [emitted] +asset 544.output.js 858 bytes [emitted] +asset 718.output.js 858 bytes [emitted] chunk (runtime: main) output.js (main) 441 bytes (javascript) 5.54 KiB (runtime) [entry] [rendered] > ./example.js main runtime modules 5.54 KiB 8 modules @@ -379,31 +376,31 @@ chunk (runtime: main) 398.output.js 38 bytes [rendered] ./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 + import() context element ./bar ./templates/ lazy ^\.\/.*$ namespace object ./bar + import() 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] [used exports unknown] - context element ./baz ./templates/ lazy ^\.\/.*$ namespace object ./baz - context element ./baz.js ./templates/ lazy ^\.\/.*$ namespace object ./baz.js + import() context element ./baz ./templates/ lazy ^\.\/.*$ namespace object ./baz + import() 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] [used exports unknown] - context element ./foo ./templates/ lazy ^\.\/.*$ namespace object ./foo - context element ./foo.js ./templates/ lazy ^\.\/.*$ namespace object ./foo.js -webpack 5.11.1 compiled successfully + import() context element ./foo ./templates/ lazy ^\.\/.*$ namespace object ./foo + import() context element ./foo.js ./templates/ lazy ^\.\/.*$ namespace object ./foo.js +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset output.js 2.43 KiB [emitted] [minimized] (name: main) +asset output.js 2.44 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] @@ -419,21 +416,21 @@ chunk (runtime: main) 398.output.js 38 bytes [rendered] > ./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 + import() context element ./bar ./templates/ lazy ^\.\/.*$ namespace object ./bar + import() 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 + import() context element ./baz ./templates/ lazy ^\.\/.*$ namespace object ./baz + import() 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.11.1 compiled successfully + import() context element ./foo ./templates/ lazy ^\.\/.*$ namespace object ./foo + import() context element ./foo.js ./templates/ lazy ^\.\/.*$ namespace object ./foo.js +webpack 5.51.1 compiled successfully ``` diff --git a/examples/code-splitting-specify-chunk-name/README.md b/examples/code-splitting-specify-chunk-name/README.md index a14fb23cdc8..cb380d3de04 100644 --- a/examples/code-splitting-specify-chunk-name/README.md +++ b/examples/code-splitting-specify-chunk-name/README.md @@ -79,7 +79,7 @@ function webpackAsyncContext(req) { return __webpack_require__(id); }); } -webpackAsyncContext.keys = () => Object.keys(map); +webpackAsyncContext.keys = () => (Object.keys(map)); webpackAsyncContext.id = 1; module.exports = webpackAsyncContext; @@ -97,8 +97,9 @@ module.exports = webpackAsyncContext; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -154,7 +155,7 @@ module.exports = webpackAsyncContext; /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ @@ -162,7 +163,7 @@ module.exports = webpackAsyncContext; /******/ 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) => { +/******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { @@ -192,7 +193,7 @@ module.exports = webpackAsyncContext; /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); -/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ ; @@ -225,12 +226,11 @@ module.exports = webpackAsyncContext; /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 179: 0 /******/ }; /******/ -/******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { /******/ // JSONP chunk loading for javascript /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; @@ -242,9 +242,7 @@ module.exports = webpackAsyncContext; /******/ } else { /******/ if(true) { // all chunks have JS /******/ // setup Promise in chunk cache -/******/ var promise = new Promise((resolve, reject) => { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading @@ -266,7 +264,7 @@ module.exports = webpackAsyncContext; /******/ } /******/ } /******/ }; -/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -280,30 +278,29 @@ module.exports = webpackAsyncContext; /******/ /******/ // no HMR manifest /******/ -/******/ // no deferred startup +/******/ // no on chunks loaded /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); +/******/ installedChunks[chunkId][0](); /******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); +/******/ installedChunks[chunkIds[i]] = 0; /******/ } /******/ /******/ } @@ -311,8 +308,6 @@ module.exports = webpackAsyncContext; /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ // no deferred startup /******/ })(); /******/ /************************************************************************/ @@ -321,6 +316,8 @@ module.exports = webpackAsyncContext; ``` js +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { /*!********************!*\ !*** ./example.js ***! @@ -354,10 +351,10 @@ __webpack_require__(1)("./ba" + createContextVar).then(function(bar) { ## Unoptimized ``` -asset output.js 11.2 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) +asset output.js 11.3 KiB [emitted] (name: main) +asset 548.output.js 858 bytes [emitted] (name: chunk-bar-baz2) +asset 791.output.js 858 bytes [emitted] (name: chunk-bar-baz0) +asset 930.output.js 858 bytes [emitted] (name: chunk-foo) chunk (runtime: main) output.js (main) 565 bytes (javascript) 5.54 KiB (runtime) [entry] [rendered] > ./example.js main runtime modules 5.54 KiB 8 modules @@ -371,16 +368,16 @@ chunk (runtime: main) 548.output.js (chunk-bar-baz2) 38 bytes [rendered] ./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 + import() context element ./baz ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz + import() 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] [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 + import() context element ./bar ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar + import() 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 @@ -389,13 +386,13 @@ chunk (runtime: main) 930.output.js (chunk-foo) 38 bytes [rendered] [used exports unknown] import() ./templates/foo ./example.js 1:0-62 cjs require ./templates/foo ./example.js 6:11-37 -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset output.js 2.44 KiB [emitted] [minimized] (name: main) +asset output.js 2.45 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) @@ -411,15 +408,15 @@ chunk (runtime: main) 548.output.js (chunk-bar-baz2) 38 bytes [rendered] > ./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 + import() context element ./baz ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./baz + import() 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 + import() context element ./bar ./templates/ lazy ^\.\/ba.*$ chunkName: chunk-bar-baz namespace object ./bar + import() 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 @@ -427,5 +424,5 @@ chunk (runtime: main) 930.output.js (chunk-foo) 38 bytes [rendered] [exports: default] import() ./templates/foo ./example.js 1:0-62 cjs require ./templates/foo ./example.js 6:11-37 -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/code-splitting/README.md b/examples/code-splitting/README.md index d1391a9375b..415508936d3 100644 --- a/examples/code-splitting/README.md +++ b/examples/code-splitting/README.md @@ -75,8 +75,9 @@ require.ensure(["c"], function(require) { /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -120,7 +121,7 @@ require.ensure(["c"], function(require) { /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ @@ -128,7 +129,7 @@ require.ensure(["c"], function(require) { /******/ 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) => { +/******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { @@ -158,7 +159,7 @@ require.ensure(["c"], function(require) { /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); -/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ ; @@ -180,12 +181,11 @@ require.ensure(["c"], function(require) { /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 179: 0 /******/ }; /******/ -/******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { /******/ // JSONP chunk loading for javascript /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; @@ -197,9 +197,7 @@ require.ensure(["c"], function(require) { /******/ } else { /******/ if(true) { // all chunks have JS /******/ // setup Promise in chunk cache -/******/ var promise = new Promise((resolve, reject) => { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading @@ -221,7 +219,7 @@ require.ensure(["c"], function(require) { /******/ } /******/ } /******/ }; -/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -235,30 +233,29 @@ require.ensure(["c"], function(require) { /******/ /******/ // no HMR manifest /******/ -/******/ // no deferred startup +/******/ // no on chunks loaded /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); +/******/ installedChunks[chunkId][0](); /******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); +/******/ installedChunks[chunkIds[i]] = 0; /******/ } /******/ /******/ } @@ -266,8 +263,6 @@ require.ensure(["c"], function(require) { /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ // no deferred startup /******/ })(); /******/ /************************************************************************/ @@ -276,6 +271,8 @@ require.ensure(["c"], function(require) { ``` js +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { /*!********************!*\ !*** ./example.js ***! @@ -337,11 +334,11 @@ Minimized ## Unoptimized ``` -asset output.js 9.37 KiB [emitted] (name: main) +asset output.js 9.49 KiB [emitted] (name: main) asset 796.output.js 528 bytes [emitted] -chunk (runtime: main) output.js (main) 161 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 161 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules dependent modules 22 bytes [dependent] 2 modules ./example.js 139 bytes [built] [code generated] [used exports unknown] @@ -354,7 +351,7 @@ chunk (runtime: main) 796.output.js 22 bytes [rendered] ./node_modules/d.js 11 bytes [built] [code generated] [used exports unknown] cjs require d ./example.js 5:12-24 -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode @@ -362,9 +359,9 @@ webpack 5.11.1 compiled successfully ``` asset output.js 1.74 KiB [emitted] [minimized] (name: main) asset 796.output.js 80 bytes [emitted] [minimized] -chunk (runtime: main) output.js (main) 161 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 161 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules dependent modules 22 bytes [dependent] 2 modules ./example.js 139 bytes [built] [code generated] [no exports used] @@ -377,5 +374,5 @@ chunk (runtime: main) 796.output.js 22 bytes [rendered] ./node_modules/d.js 11 bytes [built] [code generated] [used exports unknown] cjs require d ./example.js 5:12-24 -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/coffee-script/README.md b/examples/coffee-script/README.md index 270fea3e54c..32ea65462f7 100644 --- a/examples/coffee-script/README.md +++ b/examples/coffee-script/README.md @@ -74,8 +74,9 @@ module.exports = 42; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -97,6 +98,8 @@ module.exports = 42; ``` js +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { /*!********************!*\ !*** ./example.js ***! @@ -115,25 +118,25 @@ console.log(__webpack_require__(/*! ./cup1 */ 1)); ## Unoptimized ``` -asset output.js 2.09 KiB [emitted] (name: main) +asset output.js 2.27 KiB [emitted] (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] [used exports unknown] entry ./example.js main -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset output.js 280 bytes [emitted] [minimized] (name: main) +asset output.js 294 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.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/common-chunk-and-vendor-chunk/README.md b/examples/common-chunk-and-vendor-chunk/README.md index 8434b15379f..637e67e798f 100644 --- a/examples/common-chunk-and-vendor-chunk/README.md +++ b/examples/common-chunk-and-vendor-chunk/README.md @@ -194,8 +194,9 @@ module.exports = "utility1"; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -214,13 +215,42 @@ module.exports = "utility1"; /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = __webpack_modules__; /******/ -/******/ // the startup function -/******/ // It's empty as some runtime module handles the default behavior -/******/ __webpack_require__.x = x => {} /************************************************************************/ +/******/ /* webpack/runtime/chunk loaded */ +/******/ (() => { +/******/ var deferred = []; +/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { +/******/ if(chunkIds) { +/******/ priority = priority || 0; +/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; +/******/ deferred[i] = [chunkIds, fn, priority]; +/******/ return; +/******/ } +/******/ var notFulfilled = Infinity; +/******/ for (var i = 0; i < deferred.length; i++) { +/******/ var [chunkIds, fn, priority] = deferred[i]; +/******/ var fulfilled = true; +/******/ for (var j = 0; j < chunkIds.length; j++) { +/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { +/******/ chunkIds.splice(j--, 1); +/******/ } else { +/******/ fulfilled = false; +/******/ if(priority < notFulfilled) notFulfilled = priority; +/******/ } +/******/ } +/******/ if(fulfilled) { +/******/ deferred.splice(i--, 1) +/******/ var r = fn(); +/******/ if (r !== undefined) result = r; +/******/ } +/******/ } +/******/ return result; +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/jsonp chunk loading */ @@ -229,14 +259,11 @@ module.exports = "utility1"; /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ "pageA": 0 /******/ }; /******/ -/******/ var deferredModules = [ -/******/ [0,"vendor","commons-utility2_js"] -/******/ ]; /******/ // no chunk on demand loading /******/ /******/ // no prefetching @@ -247,69 +274,36 @@ module.exports = "utility1"; /******/ /******/ // no HMR manifest /******/ -/******/ var checkDeferredModules = x => {}; +/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { -/******/ var [chunkIds, moreModules, runtime, executeModules] = 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); -/******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ installedChunks[chunkId][0](); /******/ } +/******/ installedChunks[chunkIds[i]] = 0; /******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); -/******/ } -/******/ -/******/ // add entry modules from loaded chunk to deferred list -/******/ if(executeModules) deferredModules.push.apply(deferredModules, executeModules); -/******/ -/******/ // run deferred modules when all chunks ready -/******/ return checkDeferredModules(); +/******/ return __webpack_require__.O(result); /******/ } /******/ /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ function checkDeferredModulesImpl() { -/******/ var result; -/******/ for(var i = 0; i < deferredModules.length; i++) { -/******/ var deferredModule = deferredModules[i]; -/******/ var fulfilled = true; -/******/ for(var j = 1; j < deferredModule.length; j++) { -/******/ var depId = deferredModule[j]; -/******/ if(installedChunks[depId] !== 0) fulfilled = false; -/******/ } -/******/ if(fulfilled) { -/******/ deferredModules.splice(i--, 1); -/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]); -/******/ } -/******/ } -/******/ if(deferredModules.length === 0) { -/******/ __webpack_require__.x(); -/******/ __webpack_require__.x = x => {}; -/******/ } -/******/ return result; -/******/ } -/******/ var startup = __webpack_require__.x; -/******/ __webpack_require__.x = () => { -/******/ // reset startup function so it can be called again when more startup code is added -/******/ __webpack_require__.x = startup || (x => {}); -/******/ return (checkDeferredModules = checkDeferredModulesImpl)(); -/******/ }; /******/ })(); /******/ /************************************************************************/ @@ -318,8 +312,13 @@ module.exports = "utility1"; ``` js -/******/ // run startup -/******/ return __webpack_require__.x(); +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module depends on other loaded chunks and execution need to be delayed +/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["vendor","commons-utility2_js"], () => (__webpack_require__(0))) +/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); +/******/ /******/ })() ; ``` @@ -361,8 +360,9 @@ module.exports = "pageB"; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -381,13 +381,42 @@ module.exports = "pageB"; /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = __webpack_modules__; /******/ -/******/ // the startup function -/******/ // It's empty as some runtime module handles the default behavior -/******/ __webpack_require__.x = x => {} /************************************************************************/ +/******/ /* webpack/runtime/chunk loaded */ +/******/ (() => { +/******/ var deferred = []; +/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { +/******/ if(chunkIds) { +/******/ priority = priority || 0; +/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; +/******/ deferred[i] = [chunkIds, fn, priority]; +/******/ return; +/******/ } +/******/ var notFulfilled = Infinity; +/******/ for (var i = 0; i < deferred.length; i++) { +/******/ var [chunkIds, fn, priority] = deferred[i]; +/******/ var fulfilled = true; +/******/ for (var j = 0; j < chunkIds.length; j++) { +/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { +/******/ chunkIds.splice(j--, 1); +/******/ } else { +/******/ fulfilled = false; +/******/ if(priority < notFulfilled) notFulfilled = priority; +/******/ } +/******/ } +/******/ if(fulfilled) { +/******/ deferred.splice(i--, 1) +/******/ var r = fn(); +/******/ if (r !== undefined) result = r; +/******/ } +/******/ } +/******/ return result; +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/jsonp chunk loading */ @@ -396,14 +425,11 @@ module.exports = "pageB"; /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ "pageB": 0 /******/ }; /******/ -/******/ var deferredModules = [ -/******/ [4,"vendor","commons-utility2_js","commons-utility3_js"] -/******/ ]; /******/ // no chunk on demand loading /******/ /******/ // no prefetching @@ -414,69 +440,36 @@ module.exports = "pageB"; /******/ /******/ // no HMR manifest /******/ -/******/ var checkDeferredModules = x => {}; +/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { -/******/ var [chunkIds, moreModules, runtime, executeModules] = 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); -/******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ installedChunks[chunkId][0](); /******/ } +/******/ installedChunks[chunkIds[i]] = 0; /******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); -/******/ } -/******/ -/******/ // add entry modules from loaded chunk to deferred list -/******/ if(executeModules) deferredModules.push.apply(deferredModules, executeModules); -/******/ -/******/ // run deferred modules when all chunks ready -/******/ return checkDeferredModules(); +/******/ return __webpack_require__.O(result); /******/ } /******/ /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ function checkDeferredModulesImpl() { -/******/ var result; -/******/ for(var i = 0; i < deferredModules.length; i++) { -/******/ var deferredModule = deferredModules[i]; -/******/ var fulfilled = true; -/******/ for(var j = 1; j < deferredModule.length; j++) { -/******/ var depId = deferredModule[j]; -/******/ if(installedChunks[depId] !== 0) fulfilled = false; -/******/ } -/******/ if(fulfilled) { -/******/ deferredModules.splice(i--, 1); -/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]); -/******/ } -/******/ } -/******/ if(deferredModules.length === 0) { -/******/ __webpack_require__.x(); -/******/ __webpack_require__.x = x => {}; -/******/ } -/******/ return result; -/******/ } -/******/ var startup = __webpack_require__.x; -/******/ __webpack_require__.x = () => { -/******/ // reset startup function so it can be called again when more startup code is added -/******/ __webpack_require__.x = startup || (x => {}); -/******/ return (checkDeferredModules = checkDeferredModulesImpl)(); -/******/ }; /******/ })(); /******/ /************************************************************************/ @@ -485,8 +478,13 @@ module.exports = "pageB"; ``` js -/******/ // run startup -/******/ return __webpack_require__.x(); +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module depends on other loaded chunks and execution need to be delayed +/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["vendor","commons-utility2_js","commons-utility3_js"], () => (__webpack_require__(4))) +/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); +/******/ /******/ })() ; ``` @@ -526,8 +524,9 @@ module.exports = "pageC"; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -546,13 +545,42 @@ module.exports = "pageC"; /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = __webpack_modules__; /******/ -/******/ // the startup function -/******/ // It's empty as some runtime module handles the default behavior -/******/ __webpack_require__.x = x => {} /************************************************************************/ +/******/ /* webpack/runtime/chunk loaded */ +/******/ (() => { +/******/ var deferred = []; +/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { +/******/ if(chunkIds) { +/******/ priority = priority || 0; +/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; +/******/ deferred[i] = [chunkIds, fn, priority]; +/******/ return; +/******/ } +/******/ var notFulfilled = Infinity; +/******/ for (var i = 0; i < deferred.length; i++) { +/******/ var [chunkIds, fn, priority] = deferred[i]; +/******/ var fulfilled = true; +/******/ for (var j = 0; j < chunkIds.length; j++) { +/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { +/******/ chunkIds.splice(j--, 1); +/******/ } else { +/******/ fulfilled = false; +/******/ if(priority < notFulfilled) notFulfilled = priority; +/******/ } +/******/ } +/******/ if(fulfilled) { +/******/ deferred.splice(i--, 1) +/******/ var r = fn(); +/******/ if (r !== undefined) result = r; +/******/ } +/******/ } +/******/ return result; +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/jsonp chunk loading */ @@ -561,14 +589,11 @@ module.exports = "pageC"; /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ "pageC": 0 /******/ }; /******/ -/******/ var deferredModules = [ -/******/ [7,"commons-utility2_js","commons-utility3_js"] -/******/ ]; /******/ // no chunk on demand loading /******/ /******/ // no prefetching @@ -579,69 +604,36 @@ module.exports = "pageC"; /******/ /******/ // no HMR manifest /******/ -/******/ var checkDeferredModules = x => {}; +/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { -/******/ var [chunkIds, moreModules, runtime, executeModules] = 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); +/******/ installedChunks[chunkId][0](); /******/ } -/******/ installedChunks[chunkId] = 0; +/******/ installedChunks[chunkIds[i]] = 0; /******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); -/******/ } -/******/ -/******/ // add entry modules from loaded chunk to deferred list -/******/ if(executeModules) deferredModules.push.apply(deferredModules, executeModules); -/******/ -/******/ // run deferred modules when all chunks ready -/******/ return checkDeferredModules(); +/******/ return __webpack_require__.O(result); /******/ } /******/ /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ function checkDeferredModulesImpl() { -/******/ var result; -/******/ for(var i = 0; i < deferredModules.length; i++) { -/******/ var deferredModule = deferredModules[i]; -/******/ var fulfilled = true; -/******/ for(var j = 1; j < deferredModule.length; j++) { -/******/ var depId = deferredModule[j]; -/******/ if(installedChunks[depId] !== 0) fulfilled = false; -/******/ } -/******/ if(fulfilled) { -/******/ deferredModules.splice(i--, 1); -/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]); -/******/ } -/******/ } -/******/ if(deferredModules.length === 0) { -/******/ __webpack_require__.x(); -/******/ __webpack_require__.x = x => {}; -/******/ } -/******/ return result; -/******/ } -/******/ var startup = __webpack_require__.x; -/******/ __webpack_require__.x = () => { -/******/ // reset startup function so it can be called again when more startup code is added -/******/ __webpack_require__.x = startup || (x => {}); -/******/ return (checkDeferredModules = checkDeferredModulesImpl)(); -/******/ }; /******/ })(); /******/ /************************************************************************/ @@ -650,8 +642,13 @@ module.exports = "pageC"; ``` js -/******/ // run startup -/******/ return __webpack_require__.x(); +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module depends on other loaded chunks and execution need to be delayed +/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["commons-utility2_js","commons-utility3_js"], () => (__webpack_require__(7))) +/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); +/******/ /******/ })() ; ``` @@ -664,13 +661,13 @@ module.exports = "pageC"; 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 6 KiB [emitted] (name: pageA) -asset pageB.js 5.73 KiB [emitted] (name: pageB) -asset pageC.js 5.67 KiB [emitted] (name: pageC) +asset pageA.js 6.08 KiB [emitted] (name: pageA) +asset pageB.js 5.8 KiB [emitted] (name: pageB) +asset pageC.js 5.74 KiB [emitted] (name: pageC) asset vendor.js 737 bytes [emitted] (name: vendor) (id hint: vendor) -Entrypoint pageA 7.09 KiB = vendor.js 737 bytes commons-utility2_js.js 384 bytes pageA.js 6 KiB -Entrypoint pageB 7.2 KiB = vendor.js 737 bytes commons-utility2_js.js 384 bytes commons-utility3_js.js 384 bytes pageB.js 5.73 KiB -Entrypoint pageC 6.42 KiB = commons-utility2_js.js 384 bytes commons-utility3_js.js 384 bytes pageC.js 5.67 KiB +Entrypoint pageA 7.17 KiB = vendor.js 737 bytes commons-utility2_js.js 384 bytes pageA.js 6.08 KiB +Entrypoint pageB 7.27 KiB = vendor.js 737 bytes commons-utility2_js.js 384 bytes commons-utility3_js.js 384 bytes pageB.js 5.8 KiB +Entrypoint pageC 6.49 KiB = commons-utility2_js.js 384 bytes commons-utility3_js.js 384 bytes pageC.js 5.74 KiB 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 @@ -689,24 +686,24 @@ chunk (runtime: pageB, pageC) commons-utility3_js.js (id hint: commons) 28 bytes 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.6 KiB (runtime) [entry] [rendered] +chunk (runtime: pageA) pageA.js (pageA) 165 bytes (javascript) 2.46 KiB (runtime) [entry] [rendered] > ./pageA pageA - runtime modules 2.6 KiB 2 modules + runtime modules 2.46 KiB 3 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.62 KiB (runtime) [entry] [rendered] +chunk (runtime: pageB) pageB.js (pageB) 137 bytes (javascript) 2.46 KiB (runtime) [entry] [rendered] > ./pageB pageB - runtime modules 2.62 KiB 2 modules + runtime modules 2.46 KiB 3 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.61 KiB (runtime) [entry] [rendered] +chunk (runtime: pageC) pageC.js (pageC) 102 bytes (javascript) 2.46 KiB (runtime) [entry] [rendered] > ./pageC pageC - runtime modules 2.61 KiB 2 modules + runtime modules 2.46 KiB 3 modules ./pageC.js 102 bytes [built] [code generated] [used exports unknown] cjs self exports reference ./pageC.js 4:0-14 @@ -722,7 +719,7 @@ chunk (runtime: pageA, pageB) vendor.js (vendor) (id hint: vendor) 54 bytes [ini [used exports unknown] cjs self exports reference ./node_modules/vendor2.js 1:0-14 cjs require vendor2 ./pageB.js 1:14-32 -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode @@ -731,13 +728,13 @@ webpack 5.11.1 compiled successfully 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 907 bytes [emitted] [minimized] (name: pageA) -asset pageB.js 899 bytes [emitted] [minimized] (name: pageB) -asset pageC.js 883 bytes [emitted] [minimized] (name: pageC) +asset pageA.js 1.01 KiB [emitted] [minimized] (name: pageA) +asset pageB.js 1 KiB [emitted] [minimized] (name: pageB) +asset pageC.js 1010 bytes [emitted] [minimized] (name: pageC) asset vendor.js 121 bytes [emitted] [minimized] (name: vendor) (id hint: vendor) -Entrypoint pageA 1.11 KiB = vendor.js 121 bytes commons-utility2_js.js 106 bytes pageA.js 907 bytes -Entrypoint pageB 1.2 KiB = vendor.js 121 bytes commons-utility2_js.js 106 bytes commons-utility3_js.js 106 bytes pageB.js 899 bytes -Entrypoint pageC 1.07 KiB = commons-utility2_js.js 106 bytes commons-utility3_js.js 106 bytes pageC.js 883 bytes +Entrypoint pageA 1.23 KiB = vendor.js 121 bytes commons-utility2_js.js 106 bytes pageA.js 1.01 KiB +Entrypoint pageB 1.33 KiB = vendor.js 121 bytes commons-utility2_js.js 106 bytes commons-utility3_js.js 106 bytes pageB.js 1 KiB +Entrypoint pageC 1.19 KiB = commons-utility2_js.js 106 bytes commons-utility3_js.js 106 bytes pageC.js 1010 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 @@ -756,24 +753,24 @@ chunk (runtime: pageB, pageC) commons-utility3_js.js (id hint: commons) 28 bytes 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.6 KiB (runtime) [entry] [rendered] +chunk (runtime: pageA) pageA.js (pageA) 165 bytes (javascript) 2.46 KiB (runtime) [entry] [rendered] > ./pageA pageA - runtime modules 2.6 KiB 2 modules + runtime modules 2.46 KiB 3 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] +chunk (runtime: pageB) pageB.js (pageB) 137 bytes (javascript) 2.46 KiB (runtime) [entry] [rendered] > ./pageB pageB - runtime modules 2.63 KiB 2 modules + runtime modules 2.46 KiB 3 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] +chunk (runtime: pageC) pageC.js (pageC) 102 bytes (javascript) 2.46 KiB (runtime) [entry] [rendered] > ./pageC pageC - runtime modules 2.62 KiB 2 modules + runtime modules 2.46 KiB 3 modules ./pageC.js 102 bytes [built] [code generated] [used exports unknown] cjs self exports reference ./pageC.js 4:0-14 @@ -789,5 +786,5 @@ chunk (runtime: pageA, pageB) vendor.js (vendor) (id hint: vendor) 54 bytes [ini [used exports unknown] cjs self exports reference ./node_modules/vendor2.js 1:0-14 cjs require vendor2 ./pageB.js 1:14-32 -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/common-chunk-grandchildren/README.md b/examples/common-chunk-grandchildren/README.md index b4491f7dfcd..ec028a663ec 100644 --- a/examples/common-chunk-grandchildren/README.md +++ b/examples/common-chunk-grandchildren/README.md @@ -120,8 +120,9 @@ module.exports = { /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -165,7 +166,7 @@ module.exports = { /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ @@ -173,7 +174,7 @@ module.exports = { /******/ 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) => { +/******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { @@ -203,7 +204,7 @@ module.exports = { /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); -/******/ doneFns && doneFns.forEach((fn) => fn(event)); +/******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ ; @@ -225,12 +226,11 @@ module.exports = { /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 179: 0 /******/ }; /******/ -/******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { /******/ // JSONP chunk loading for javascript /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; @@ -242,9 +242,7 @@ module.exports = { /******/ } else { /******/ if(true) { // all chunks have JS /******/ // setup Promise in chunk cache -/******/ var promise = new Promise((resolve, reject) => { -/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; -/******/ }); +/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading @@ -266,7 +264,7 @@ module.exports = { /******/ } /******/ } /******/ }; -/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId); +/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); /******/ } else installedChunks[chunkId] = 0; /******/ } /******/ } @@ -280,30 +278,29 @@ module.exports = { /******/ /******/ // no HMR manifest /******/ -/******/ // no deferred startup +/******/ // no on chunks loaded /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, 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 = []; +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ resolves.push(installedChunks[chunkId][0]); +/******/ installedChunks[chunkId][0](); /******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) runtime(__webpack_require__); -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ while(resolves.length) { -/******/ resolves.shift()(); +/******/ installedChunks[chunkIds[i]] = 0; /******/ } /******/ /******/ } @@ -311,8 +308,6 @@ module.exports = { /******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ -/******/ // no deferred startup /******/ })(); /******/ /************************************************************************/ @@ -321,6 +316,7 @@ module.exports = { ``` js +var __webpack_exports__ = {}; /*!********************!*\ !*** ./example.js ***! \********************/ @@ -454,7 +450,7 @@ module.exports = function() { ## Unoptimized ``` -asset output.js 9.1 KiB [emitted] (name: main) +asset output.js 9.11 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] @@ -465,9 +461,9 @@ chunk (runtime: main) 145.output.js 136 bytes [rendered] [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.97 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 220 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules ./example.js 220 bytes [built] [code generated] [used exports unknown] entry ./example.js main @@ -491,13 +487,13 @@ chunk (runtime: main) 588.output.js 133 bytes [rendered] [used exports unknown] cjs require ./pageB ./example.js 8:15-33 cjs self exports reference ./pageB.js 1:0-14 -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset output.js 1.79 KiB [emitted] [minimized] (name: main) +asset output.js 1.8 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] @@ -508,9 +504,9 @@ chunk (runtime: main) 145.output.js 136 bytes [rendered] [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.97 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 220 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 4.97 KiB 6 modules + runtime modules 4.98 KiB 6 modules ./example.js 220 bytes [built] [code generated] [no exports used] entry ./example.js main @@ -534,5 +530,5 @@ chunk (runtime: main) 588.output.js 133 bytes [rendered] [used exports unknown] cjs require ./pageB ./example.js 8:15-33 cjs self exports reference ./pageB.js 1:0-14 -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/commonjs/README.md b/examples/commonjs/README.md index 06efad94f70..e8a15d44582 100644 --- a/examples/commonjs/README.md +++ b/examples/commonjs/README.md @@ -90,8 +90,9 @@ exports.add = function() { /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -113,6 +114,8 @@ exports.add = function() { ``` js +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { /*!********************!*\ !*** ./example.js ***! @@ -134,25 +137,25 @@ inc(a); // 2 ## Unoptimized ``` -asset output.js 2.34 KiB [emitted] (name: main) +asset output.js 2.51 KiB [emitted] (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] [used exports unknown] entry ./example.js main -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset output.js 296 bytes [emitted] [minimized] (name: main) +asset output.js 310 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.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` diff --git a/examples/custom-json-modules/README.md b/examples/custom-json-modules/README.md index 113cb382c53..b710907305d 100644 --- a/examples/custom-json-modules/README.md +++ b/examples/custom-json-modules/README.md @@ -101,33 +101,7 @@ module.exports = { /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ([ -/* 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('

'); - - -/***/ }), +/* 0 */, /* 1 */ /*!*******************!*\ !*** ./data.toml ***! @@ -145,7 +119,7 @@ document.querySelector('#app').innerHTML = [_data_toml__WEBPACK_IMPORTED_MODULE_ /*! runtime requirements: module */ /***/ ((module) => { -module.exports = JSON.parse("{\"title\":\"TOML Example\",\"owner\":{\"name\":\"Tom Preston-Werner\",\"organization\":\"GitHub\",\"bio\":\"GitHub Cofounder & CEO\\nLikes tater tots and beer.\",\"dob\":\"1979-05-27T07:32:00.000Z\"}}"); +module.exports = JSON.parse('{"title":"TOML Example","owner":{"name":"Tom Preston-Werner","organization":"GitHub","bio":"GitHub Cofounder & CEO\\nLikes tater tots and beer.","dob":"1979-05-27T07:32:00.000Z"}}'); /***/ }), /* 2 */ @@ -165,7 +139,7 @@ module.exports = JSON.parse("{\"title\":\"TOML Example\",\"owner\":{\"name\":\"T /*! runtime requirements: module */ /***/ ((module) => { -module.exports = JSON.parse("{\"title\":\"YAML Example\",\"owner\":{\"name\":\"Tom Preston-Werner\",\"organization\":\"GitHub\",\"bio\":\"GitHub Cofounder & CEO\\nLikes tater tots and beer.\",\"dob\":\"1979-05-27T07:32:00.000Z\"}}"); +module.exports = JSON.parse('{"title":"YAML Example","owner":{"name":"Tom Preston-Werner","organization":"GitHub","bio":"GitHub Cofounder & CEO\\nLikes tater tots and beer.","dob":"1979-05-27T07:32:00.000Z"}}'); /***/ }), /* 3 */ @@ -184,7 +158,7 @@ module.exports = JSON.parse("{\"title\":\"YAML Example\",\"owner\":{\"name\":\"T /*! runtime requirements: module */ /***/ ((module) => { -module.exports = JSON.parse("{\"title\":\"JSON5 Example\",\"owner\":{\"name\":\"Tom Preston-Werner\",\"organization\":\"GitHub\",\"bio\":\"GitHub Cofounder & CEO\\nLikes tater tots and beer.\",\"dob\":\"1979-05-27T07:32:00.000Z\"}}"); +module.exports = JSON.parse('{"title":"JSON5 Example","owner":{"name":"Tom Preston-Werner","organization":"GitHub","bio":"GitHub Cofounder & CEO\\nLikes tater tots and beer.","dob":"1979-05-27T07:32:00.000Z"}}'); /***/ }) /******/ ]); @@ -200,8 +174,9 @@ module.exports = JSON.parse("{\"title\":\"JSON5 Example\",\"owner\":{\"name\":\" /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -235,10 +210,33 @@ module.exports = JSON.parse("{\"title\":\"JSON5 Example\",\"owner\":{\"name\":\" ``` js -/******/ // startup -/******/ // Load entry module -/******/ __webpack_require__(0); -/******/ // This entry module used 'exports' so it can't be inlined +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { +/*!********************!*\ + !*** ./example.js ***! + \********************/ +/*! namespace exports */ +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.r, __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('

'); + +})(); + /******/ })() ; ``` @@ -248,7 +246,7 @@ module.exports = JSON.parse("{\"title\":\"JSON5 Example\",\"owner\":{\"name\":\" ## webpack output ``` -asset output.js 5.98 KiB [emitted] (name: main) +asset output.js 5.87 KiB [emitted] (name: main) chunk (runtime: main) output.js (main) 919 bytes (javascript) 274 bytes (runtime) [entry] [rendered] > ./example.js main dependent modules 565 bytes [dependent] 3 modules @@ -257,5 +255,5 @@ chunk (runtime: main) output.js (main) 919 bytes (javascript) 274 bytes (runtime [no exports] [used exports unknown] entry ./example.js main -webpack 5.11.1 compiled successfully +webpack 5.51.1 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 1e2b1100f7e..03f49db1171 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_d696c7b4f72a4a70f39b;vendor_lib_d696c7b4f72a4a70f39b = +var vendor_lib_51062e5e93ee3a0507e7; /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ([ /* 0 */ @@ -68,7 +68,7 @@ module.exports = __webpack_require__; "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "square": () => /* binding */ square +/* harmony export */ "square": () => (/* binding */ square) /* harmony export */ }); function square(n) { return n * n; @@ -89,8 +89,9 @@ function square(n) { /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -121,7 +122,7 @@ function square(n) { /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ @@ -141,10 +142,13 @@ function square(n) { ``` js -/******/ // module exports must be returned from runtime so entry inlining is disabled +/******/ /******/ // startup /******/ // Load entry module and return exports -/******/ return __webpack_require__(0); +/******/ // This entry module doesn't tell about it's top-level declarations so it can't be inlined +/******/ var __webpack_exports__ = __webpack_require__(0); +/******/ vendor_lib_51062e5e93ee3a0507e7 = __webpack_exports__; +/******/ /******/ })() ; ``` @@ -152,7 +156,7 @@ function square(n) { # dist/vendor-manifest.json ```javascript -{"name":"vendor_lib_d696c7b4f72a4a70f39b","content":{"../node_modules/example-vendor.js":{"id":1,"buildMeta":{"exportsType":"namespace"},"exports":["square"]}}} +{"name":"vendor_lib_51062e5e93ee3a0507e7","content":{"../node_modules/example-vendor.js":{"id":1,"buildMeta":{"exportsType":"namespace"},"exports":["square"]}}} ``` # Info @@ -160,28 +164,28 @@ function square(n) { ## Unoptimized ``` -asset vendor.js 3.56 KiB [emitted] (name: main) -chunk (runtime: main) vendor.js (main) 57 bytes (javascript) 668 bytes (runtime) [entry] [rendered] +asset vendor.js 3.68 KiB [emitted] (name: main) +chunk (runtime: main) vendor.js (main) 57 bytes (javascript) 670 bytes (runtime) [entry] [rendered] > main - runtime modules 668 bytes 3 modules + runtime modules 670 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.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset vendor.js 638 bytes [emitted] [minimized] (name: main) -chunk (runtime: main) vendor.js (main) 57 bytes (javascript) 668 bytes (runtime) [entry] [rendered] +asset vendor.js 653 bytes [emitted] [minimized] (name: main) +chunk (runtime: main) vendor.js (main) 57 bytes (javascript) 670 bytes (runtime) [entry] [rendered] > main - runtime modules 668 bytes 3 modules + runtime modules 670 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.11.1 compiled successfully +webpack 5.51.1 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 83238a34185..4d0ac5032f0 100644 --- a/examples/dll-app-and-vendor/1-app/README.md +++ b/examples/dll-app-and-vendor/1-app/README.md @@ -50,28 +50,10 @@ console.log(new square(7)); ```javascript /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ([ -/* 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)); - - -/***/ }), +/* 0 */, /* 1 */ /*!******************************************************************************************************!*\ - !*** delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_d696c7b4f72a4a70f39b ***! + !*** delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_51062e5e93ee3a0507e7 ***! \******************************************************************************************************/ /*! namespace exports */ /*! export square [provided] [no usage info] [provision prevents renaming (no use info)] */ @@ -79,12 +61,12 @@ console.log(new example_vendor__WEBPACK_IMPORTED_MODULE_0__.square(7)); /*! runtime requirements: module, __webpack_require__ */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -module.exports = (__webpack_require__(/*! dll-reference vendor_lib_d696c7b4f72a4a70f39b */ 2))(1); +module.exports = (__webpack_require__(/*! dll-reference vendor_lib_51062e5e93ee3a0507e7 */ 2))(1); /***/ }), /* 2 */ /*!**************************************************!*\ - !*** external "vendor_lib_d696c7b4f72a4a70f39b" ***! + !*** external "vendor_lib_51062e5e93ee3a0507e7" ***! \**************************************************/ /*! dynamic exports */ /*! exports [maybe provided (runtime-defined)] [no usage info] */ @@ -92,7 +74,7 @@ module.exports = (__webpack_require__(/*! dll-reference vendor_lib_d696c7b4f72a4 /***/ ((module) => { "use strict"; -module.exports = vendor_lib_d696c7b4f72a4a70f39b; +module.exports = vendor_lib_51062e5e93ee3a0507e7; /***/ }) /******/ ]); @@ -108,8 +90,9 @@ module.exports = vendor_lib_d696c7b4f72a4a70f39b; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache -/******/ if(__webpack_module_cache__[moduleId]) { -/******/ return __webpack_module_cache__[moduleId].exports; +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { @@ -143,10 +126,25 @@ module.exports = vendor_lib_d696c7b4f72a4a70f39b; ``` js -/******/ // startup -/******/ // Load entry module -/******/ __webpack_require__(0); -/******/ // This entry module used 'exports' so it can't be inlined +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be in strict mode. +(() => { +"use strict"; +/*!************************!*\ + !*** ./example-app.js ***! + \************************/ +/*! namespace exports */ +/*! exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ +__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)); + +})(); + /******/ })() ; ``` @@ -156,7 +154,7 @@ module.exports = vendor_lib_d696c7b4f72a4a70f39b; ## Unoptimized ``` -asset app.js 3.52 KiB [emitted] (name: main) +asset app.js 3.44 KiB [emitted] (name: main) chunk (runtime: main) app.js (main) 178 bytes (javascript) 274 bytes (runtime) [entry] [rendered] > ./example-app main dependent modules 84 bytes [dependent] 2 modules @@ -165,13 +163,13 @@ chunk (runtime: main) app.js (main) 178 bytes (javascript) 274 bytes (runtime) [ [no exports] [used exports unknown] entry ./example-app main -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ``` ## Production mode ``` -asset app.js 319 bytes [emitted] [minimized] (name: main) +asset app.js 333 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 @@ -179,7 +177,7 @@ chunk (runtime: main) app.js (main) 178 bytes [entry] [rendered] [no exports] [no exports used] entry ./example-app main -webpack 5.11.1 compiled successfully +webpack 5.51.1 compiled successfully ```