Skip to content

Commit f5bd213

Browse files
committed
Update examples
1 parent e400445 commit f5bd213

File tree

43 files changed

+412
-419
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+412
-419
lines changed

examples/aggressive-merging/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module.exports = {
6060

6161
```
6262
Hash: 0a1b2c3d4e5f6a7b8c9d
63-
Version: webpack 4.0.0-beta.2
63+
Version: webpack 4.5.0
6464
Asset Size Chunks Chunk Names
6565
0.chunk.js 5.98 KiB 0 [emitted]
6666
1.chunk.js 405 bytes 1 [emitted]
@@ -108,11 +108,11 @@ chunk {4} pageA.bundle.js (pageA) 71 bytes >{0}< [entry] [rendered]
108108

109109
```
110110
Hash: 0a1b2c3d4e5f6a7b8c9d
111-
Version: webpack 4.0.0-beta.2
111+
Version: webpack 4.5.0
112112
Asset Size Chunks Chunk Names
113113
0.chunk.js 173 bytes 0, 1 [emitted]
114114
1.chunk.js 118 bytes 1 [emitted]
115-
pageC.bundle.js 1.68 KiB 2 [emitted] pageC
115+
pageC.bundle.js 1.67 KiB 2 [emitted] pageC
116116
pageB.bundle.js 1.66 KiB 3 [emitted] pageB
117117
pageA.bundle.js 1.66 KiB 4 [emitted] pageA
118118
Entrypoint pageA = pageA.bundle.js

examples/chunkhash/README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = {
4545

4646
<!-- inlined minimized file "runtime~main.[chunkhash].js" -->
4747
<script>
48-
!function(e){function r(r){for(var n,o,i=r[0],c=r[1],s=r[2],p=0,f=[];p<i.length;p++)o=i[p],u[o]&&f.push(u[o][0]),u[o]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);f.length;)f.shift()();return a.push.apply(a,s||[]),t()}function t(){for(var e,r=0;r<a.length;r++){for(var t=a[r],o=!0,i=1;i<t.length;i++){var c=t[i];0!==u[c]&&(o=!1)}o&&(a.splice(r--,1),e=n(n.s=t[0]))}return e}function n(r){if(o[r])return o[r].exports;var t=o[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var o={},u={2:0},a=[];n.e=function(e){var r=[],t=u[e];if(0!==t)if(t)r.push(t[2]);else{var o=new Promise(function(r,n){t=u[e]=[r,n]});r.push(t[2]=o);var a=document.getElementsByTagName("head")[0],i=document.createElement("script");i.charset="utf-8",i.timeout=12e4,n.nc&&i.setAttribute("nonce",n.nc),i.src=n.p+""+({}[e]||e)+".[chunkhash].js";var c=setTimeout(function(){s({type:"timeout",target:i})},12e4);i.onerror=i.onload=s;function s(r){i.onerror=i.onload=null,clearTimeout(c);var t=u[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src,a=new Error("Loading chunk "+e+" failed.\n("+n+": "+o+")");a.type=n,a.request=o,t[1](a)}u[e]=void 0}}a.appendChild(i)}return Promise.all(r)},n.m=e,n.c=o,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="dist/",n.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var s=0;s<i.length;s++)r(i[s]);var l=c;t()}([]);
48+
!function(e){function r(r){for(var n,a,i=r[0],c=r[1],s=r[2],p=0,f=[];p<i.length;p++)a=i[p],o[a]&&f.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);f.length;)f.shift()();return u.push.apply(u,s||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var c=t[i];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={2:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var u=document.getElementsByTagName("head")[0],i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=a.p+""+({}[e]||e)+".[chunkhash].js";var c=setTimeout(function(){s({type:"timeout",target:i})},12e4);function s(r){i.onerror=i.onload=null,clearTimeout(c);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src,a=new Error("Loading chunk "+e+" failed.\n("+n+": "+u+")");a.type=n,a.request=u,t[1](a)}o[e]=void 0}}i.onerror=i.onload=s,u.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},a.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="dist/",a.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var s=0;s<i.length;s++)r(i[s]);var l=c;t()}([]);
4949
</script>
5050

5151
<script src="dist/main.[chunkhash].js"></script>
@@ -63,7 +63,7 @@ module.exports = {
6363
/******/ // install a JSONP callback for chunk loading
6464
/******/ function webpackJsonpCallback(data) {
6565
/******/ var chunkIds = data[0];
66-
/******/ var moreModules = data[1]
66+
/******/ var moreModules = data[1];
6767
/******/ var executeModules = data[2];
6868
/******/ // add "moreModules" to the modules object,
6969
/******/ // then flag all "chunkIds" as loaded and fire callback
@@ -168,7 +168,7 @@ module.exports = {
168168
/******/ var script = document.createElement('script');
169169
/******/
170170
/******/ script.charset = 'utf-8';
171-
/******/ script.timeout = 120000;
171+
/******/ script.timeout = 120;
172172
/******/
173173
/******/ if (__webpack_require__.nc) {
174174
/******/ script.setAttribute("nonce", __webpack_require__.nc);
@@ -273,8 +273,8 @@ module.exports = {
273273
/***/ (function(module, exports, __webpack_require__) {
274274

275275
// some module
276-
__webpack_require__.e(/*! import() */ 1).then(function() { var module = __webpack_require__(/*! ./async1 */ 1); return typeof module === "object" && module && module.__esModule ? module : { /* fake namespace object */ "default": module }; });
277-
__webpack_require__.e(/*! import() */ 2).then(function() { var module = __webpack_require__(/*! ./async2 */ 2); return typeof module === "object" && module && module.__esModule ? module : { /* fake namespace object */ "default": module }; });
276+
__webpack_require__.e(/*! import() */ 1).then(function() { var module = __webpack_require__(/*! ./async1 */ 1); return typeof module === "object" && module && module.__esModule ? module : Object.assign({/* fake namespace object */}, typeof module === "object" && module, { "default": module }); });
277+
__webpack_require__.e(/*! import() */ 2).then(function() { var module = __webpack_require__(/*! ./async2 */ 2); return typeof module === "object" && module && module.__esModule ? module : Object.assign({/* fake namespace object */}, typeof module === "object" && module, { "default": module }); });
278278

279279

280280
/***/ })
@@ -287,16 +287,16 @@ __webpack_require__.e(/*! import() */ 2).then(function() { var module = __webpac
287287

288288
```
289289
Hash: 0a1b2c3d4e5f6a7b8c9d
290-
Version: webpack 4.0.0-beta.2
290+
Version: webpack 4.5.0
291291
Asset Size Chunks Chunk Names
292-
main.[chunkhash].js 768 bytes 0 [emitted] main
292+
main.[chunkhash].js 877 bytes 0 [emitted] main
293293
1.[chunkhash].js 270 bytes 1 [emitted]
294294
2.[chunkhash].js 264 bytes 2 [emitted]
295-
runtime~main.[chunkhash].js 7.49 KiB 3 [emitted] runtime~main
295+
runtime~main.[chunkhash].js 7.48 KiB 3 [emitted] runtime~main
296296
Entrypoint main = runtime~main.[chunkhash].js main.[chunkhash].js
297-
chunk {0} main.[chunkhash].js (main) 58 bytes ={3}= >{1}< >{2}< [initial] [rendered]
297+
chunk {0} main.[chunkhash].js (main) 55 bytes ={3}= >{1}< >{2}< [initial] [rendered]
298298
> ./example main
299-
[0] ./example.js 58 bytes {0} [built]
299+
[0] ./example.js 55 bytes {0} [built]
300300
single entry ./example main
301301
chunk {1} 1.[chunkhash].js 29 bytes <{0}> <{3}> [rendered]
302302
> ./async1 [0] ./example.js 2:0-18
@@ -314,12 +314,12 @@ chunk {3} runtime~main.[chunkhash].js (runtime~main) 0 bytes ={0}= >{1}< >{2}
314314

315315
```
316316
Hash: 0a1b2c3d4e5f6a7b8c9d
317-
Version: webpack 4.0.0-beta.2
317+
Version: webpack 4.5.0
318318
Asset Size Chunks Chunk Names
319319
0.[chunkhash].js 77 bytes 0 [emitted]
320320
1.[chunkhash].js 78 bytes 1 [emitted]
321321
runtime~main.[chunkhash].js 1.76 KiB 2 [emitted] runtime~main
322-
main.[chunkhash].js 269 bytes 3 [emitted] main
322+
main.[chunkhash].js 349 bytes 3 [emitted] main
323323
Entrypoint main = runtime~main.[chunkhash].js main.[chunkhash].js
324324
chunk {0} 0.[chunkhash].js 29 bytes <{2}> <{3}> [rendered]
325325
> ./async2 [0] ./example.js 3:0-18
@@ -331,8 +331,8 @@ chunk {1} 1.[chunkhash].js 29 bytes <{2}> <{3}> [rendered]
331331
import() ./async1 [0] ./example.js 2:0-18
332332
chunk {2} runtime~main.[chunkhash].js (runtime~main) 0 bytes ={3}= >{0}< >{1}< [entry] [rendered]
333333
> ./example main
334-
chunk {3} main.[chunkhash].js (main) 58 bytes ={2}= >{0}< >{1}< [initial] [rendered]
334+
chunk {3} main.[chunkhash].js (main) 55 bytes ={2}= >{0}< >{1}< [initial] [rendered]
335335
> ./example main
336-
[0] ./example.js 58 bytes {3} [built]
336+
[0] ./example.js 55 bytes {3} [built]
337337
single entry ./example main
338338
```

examples/code-splitted-require.context-amd/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ getTemplate("b", function(b) {
2323
/******/ // install a JSONP callback for chunk loading
2424
/******/ function webpackJsonpCallback(data) {
2525
/******/ var chunkIds = data[0];
26-
/******/ var moreModules = data[1]
26+
/******/ var moreModules = data[1];
2727
/******/
2828
/******/ // add "moreModules" to the modules object,
2929
/******/ // then flag all "chunkIds" as loaded and fire callback
@@ -108,7 +108,7 @@ getTemplate("b", function(b) {
108108
/******/ var script = document.createElement('script');
109109
/******/
110110
/******/ script.charset = 'utf-8';
111-
/******/ script.timeout = 120000;
111+
/******/ script.timeout = 120;
112112
/******/
113113
/******/ if (__webpack_require__.nc) {
114114
/******/ script.setAttribute("nonce", __webpack_require__.nc);
@@ -311,7 +311,7 @@ module.exports = function() {
311311

312312
```
313313
Hash: 0a1b2c3d4e5f6a7b8c9d
314-
Version: webpack 4.0.0-beta.2
314+
Version: webpack 4.5.0
315315
Asset Size Chunks Chunk Names
316316
0.output.js 1.86 KiB 0 [emitted]
317317
output.js 7.19 KiB 1 [emitted] main
@@ -339,7 +339,7 @@ chunk {1} output.js (main) 261 bytes >{0}< [entry] [rendered]
339339

340340
```
341341
Hash: 0a1b2c3d4e5f6a7b8c9d
342-
Version: webpack 4.0.0-beta.2
342+
Version: webpack 4.5.0
343343
Asset Size Chunks Chunk Names
344344
0.output.js 627 bytes 0 [emitted]
345345
output.js 1.75 KiB 1 [emitted] main

examples/code-splitted-require.context/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ getTemplate("b", function(b) {
2323
/******/ // install a JSONP callback for chunk loading
2424
/******/ function webpackJsonpCallback(data) {
2525
/******/ var chunkIds = data[0];
26-
/******/ var moreModules = data[1]
26+
/******/ var moreModules = data[1];
2727
/******/
2828
/******/ // add "moreModules" to the modules object,
2929
/******/ // then flag all "chunkIds" as loaded and fire callback
@@ -108,7 +108,7 @@ getTemplate("b", function(b) {
108108
/******/ var script = document.createElement('script');
109109
/******/
110110
/******/ script.charset = 'utf-8';
111-
/******/ script.timeout = 120000;
111+
/******/ script.timeout = 120;
112112
/******/
113113
/******/ if (__webpack_require__.nc) {
114114
/******/ script.setAttribute("nonce", __webpack_require__.nc);
@@ -311,7 +311,7 @@ module.exports = function() {
311311

312312
```
313313
Hash: 0a1b2c3d4e5f6a7b8c9d
314-
Version: webpack 4.0.0-beta.2
314+
Version: webpack 4.5.0
315315
Asset Size Chunks Chunk Names
316316
0.output.js 1.86 KiB 0 [emitted]
317317
output.js 7.13 KiB 1 [emitted] main
@@ -339,7 +339,7 @@ chunk {1} output.js (main) 276 bytes >{0}< [entry] [rendered]
339339

340340
```
341341
Hash: 0a1b2c3d4e5f6a7b8c9d
342-
Version: webpack 4.0.0-beta.2
342+
Version: webpack 4.5.0
343343
Asset Size Chunks Chunk Names
344344
0.output.js 627 bytes 0 [emitted]
345345
output.js 1.73 KiB 1 [emitted] main

examples/code-splitting-bundle-loader/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = "It works";
2626
/******/ // install a JSONP callback for chunk loading
2727
/******/ function webpackJsonpCallback(data) {
2828
/******/ var chunkIds = data[0];
29-
/******/ var moreModules = data[1]
29+
/******/ var moreModules = data[1];
3030
/******/
3131
/******/ // add "moreModules" to the modules object,
3232
/******/ // then flag all "chunkIds" as loaded and fire callback
@@ -111,7 +111,7 @@ module.exports = "It works";
111111
/******/ var script = document.createElement('script');
112112
/******/
113113
/******/ script.charset = 'utf-8';
114-
/******/ script.timeout = 120000;
114+
/******/ script.timeout = 120;
115115
/******/
116116
/******/ if (__webpack_require__.nc) {
117117
/******/ script.setAttribute("nonce", __webpack_require__.nc);
@@ -266,7 +266,7 @@ module.exports = "It works";
266266

267267
```
268268
Hash: 0a1b2c3d4e5f6a7b8c9d
269-
Version: webpack 4.0.0-beta.2
269+
Version: webpack 4.5.0
270270
Asset Size Chunks Chunk Names
271271
0.output.js 257 bytes 0 [emitted]
272272
output.js 7.56 KiB 1 [emitted] main
@@ -287,7 +287,7 @@ chunk {1} output.js (main) 378 bytes >{0}< [entry] [rendered]
287287

288288
```
289289
Hash: 0a1b2c3d4e5f6a7b8c9d
290-
Version: webpack 4.0.0-beta.2
290+
Version: webpack 4.5.0
291291
Asset Size Chunks Chunk Names
292292
0.output.js 98 bytes 0 [emitted]
293293
output.js 1.79 KiB 1 [emitted] main

examples/code-splitting-harmony/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) {
3434
/******/ // install a JSONP callback for chunk loading
3535
/******/ function webpackJsonpCallback(data) {
3636
/******/ var chunkIds = data[0];
37-
/******/ var moreModules = data[1]
37+
/******/ var moreModules = data[1];
3838
/******/
3939
/******/ // add "moreModules" to the modules object,
4040
/******/ // then flag all "chunkIds" as loaded and fire callback
@@ -119,7 +119,7 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) {
119119
/******/ var script = document.createElement('script');
120120
/******/
121121
/******/ script.charset = 'utf-8';
122-
/******/ script.timeout = 120000;
122+
/******/ script.timeout = 120;
123123
/******/
124124
/******/ if (__webpack_require__.nc) {
125125
/******/ script.setAttribute("nonce", __webpack_require__.nc);
@@ -248,7 +248,7 @@ function webpackAsyncContext(req) {
248248
}
249249
return __webpack_require__.e(ids[1]).then(function() {
250250
var module = __webpack_require__(ids[0]);
251-
return (typeof module === "object" && module && module.__esModule ? module : /* fake namespace object */ { "default": module });
251+
return (typeof module === "object" && module && module.__esModule ? module : Object.assign({/* fake namespace object */}, typeof module === "object" && module, { "default": module }));
252252
});
253253
}
254254
webpackAsyncContext.keys = function webpackAsyncContextKeys() {
@@ -281,7 +281,7 @@ __webpack_require__.r(__webpack_exports__);
281281
/* harmony import */ var a__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(a__WEBPACK_IMPORTED_MODULE_0__);
282282

283283

284-
__webpack_require__.e(/*! import() */ 2).then(function() { var module = __webpack_require__(/*! b */ 5); return typeof module === "object" && module && module.__esModule ? module : { /* fake namespace object */ "default": module }; }).then(function(b) {
284+
__webpack_require__.e(/*! import() */ 2).then(function() { var module = __webpack_require__(/*! b */ 5); return typeof module === "object" && module && module.__esModule ? module : Object.assign({/* fake namespace object */}, typeof module === "object" && module, { "default": module }); }).then(function(b) {
285285
console.log("b loaded", b);
286286
})
287287

@@ -305,12 +305,12 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) {
305305

306306
```
307307
Hash: 0a1b2c3d4e5f6a7b8c9d
308-
Version: webpack 4.0.0-beta.2
308+
Version: webpack 4.5.0
309309
Asset Size Chunks Chunk Names
310310
0.output.js 275 bytes 0 [emitted]
311311
1.output.js 284 bytes 1 [emitted]
312312
2.output.js 270 bytes 2 [emitted]
313-
output.js 8.74 KiB 3 [emitted] main
313+
output.js 8.84 KiB 3 [emitted] main
314314
Entrypoint main = output.js
315315
chunk {0} 0.output.js 13 bytes <{3}> [rendered]
316316
> ./2 [2] ./node_modules/c lazy ^\.\/.*$ namespace object ./2
@@ -337,12 +337,12 @@ chunk {3} output.js (main) 427 bytes >{0}< >{1}< >{2}< [entry] [rendered]
337337

338338
```
339339
Hash: 0a1b2c3d4e5f6a7b8c9d
340-
Version: webpack 4.0.0-beta.2
340+
Version: webpack 4.5.0
341341
Asset Size Chunks Chunk Names
342342
0.output.js 76 bytes 0 [emitted]
343343
1.output.js 77 bytes 1 [emitted]
344344
2.output.js 78 bytes 2 [emitted]
345-
output.js 2.25 KiB 3 [emitted] main
345+
output.js 2.33 KiB 3 [emitted] main
346346
Entrypoint main = output.js
347347
chunk {0} 0.output.js 13 bytes <{3}> [rendered]
348348
> ./2 [2] ./node_modules/c lazy ^\.\/.*$ namespace object ./2

0 commit comments

Comments
 (0)