Skip to content

Commit 859b8cd

Browse files
committed
updated examples
1 parent af05c14 commit 859b8cd

File tree

38 files changed

+1304
-1159
lines changed

38 files changed

+1304
-1159
lines changed

examples/aggressive-merging/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ module.exports = {
5757

5858
```
5959
Hash: 75bcce350a8b5f748873
60-
Version: webpack 2.3.2
60+
Version: webpack 2.6.0
6161
Asset Size Chunks Chunk Names
6262
0.chunk.js 5.76 kB 0 [emitted]
6363
1.chunk.js 401 bytes 1 [emitted]
64-
pageB.bundle.js 6.41 kB 2 [emitted] pageB
65-
pageA.bundle.js 6.38 kB 3 [emitted] pageA
66-
pageC.bundle.js 6.17 kB 4 [emitted] pageC
64+
pageB.bundle.js 6.58 kB 2 [emitted] pageB
65+
pageA.bundle.js 6.55 kB 3 [emitted] pageA
66+
pageC.bundle.js 6.34 kB 4 [emitted] pageC
6767
Entrypoint pageA = pageA.bundle.js
6868
Entrypoint pageB = pageB.bundle.js
6969
Entrypoint pageC = pageC.bundle.js
@@ -102,13 +102,13 @@ chunk {4} pageC.bundle.js (pageC) 70 bytes [entry] [rendered]
102102

103103
```
104104
Hash: 75bcce350a8b5f748873
105-
Version: webpack 2.3.2
105+
Version: webpack 2.6.0
106106
Asset Size Chunks Chunk Names
107107
0.chunk.js 75 bytes 0 [emitted]
108108
1.chunk.js 78 bytes 1 [emitted]
109-
pageB.bundle.js 1.48 kB 2 [emitted] pageB
110-
pageA.bundle.js 1.48 kB 3 [emitted] pageA
111-
pageC.bundle.js 1.46 kB 4 [emitted] pageC
109+
pageB.bundle.js 1.49 kB 2 [emitted] pageB
110+
pageA.bundle.js 1.49 kB 3 [emitted] pageA
111+
pageC.bundle.js 1.47 kB 4 [emitted] pageC
112112
Entrypoint pageA = pageA.bundle.js
113113
Entrypoint pageB = pageB.bundle.js
114114
Entrypoint pageC = pageC.bundle.js

examples/chunkhash/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = {
6262

6363
<!-- inlined minimized file "manifest.[chunkhash].js" -->
6464
<script>
65-
!function(e){function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var n=window.webpackJsonp;window.webpackJsonp=function(t,c,u){for(var a,i,f,s=0,l=[];s<t.length;s++)i=t[s],o[i]&&l.push(o[i][0]),o[i]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(e[a]=c[a]);for(n&&n(t,c,u);l.length;)l.shift()();if(u)for(s=0;s<u.length;s++)f=r(r.s=u[s]);return f};var t={},o={4:0};r.e=function(e){function n(){u.onerror=u.onload=null,clearTimeout(a);var r=o[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}if(0===o[e])return Promise.resolve();if(o[e])return o[e][2];var t=new Promise(function(r,n){o[e]=[r,n]});o[e][2]=t;var c=document.getElementsByTagName("head")[0],u=document.createElement("script");u.type="text/javascript",u.charset="utf-8",u.async=!0,u.timeout=12e4,r.nc&&u.setAttribute("nonce",r.nc),u.src=r.p+""+{0:"d1359b519c10df30787b",1:"06459c375ec851b0e2ae",2:"4d752abc2fcf569f13fc",3:"8d8564a703e7631bff4b"}[e]+".js";var a=setTimeout(n,12e4);return u.onerror=u.onload=n,c.appendChild(u),t},r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p="js/",r.oe=function(e){throw console.error(e),e}}([]);
65+
!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,u){for(var i,a,f,s=0,l=[];s<t.length;s++)a=t[s],o[a]&&l.push(o[a][0]),o[a]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(r&&r(t,c,u);l.length;)l.shift()();if(u)for(s=0;s<u.length;s++)f=n(n.s=u[s]);return f};var t={},o={4:0},c=new Promise(function(e){e()});n.e=function(e){function r(){i.onerror=i.onload=null,clearTimeout(a);var n=o[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}if(0===o[e])return c;if(o[e])return o[e][2];var t=new Promise(function(n,r){o[e]=[n,r]});o[e][2]=t;var u=document.getElementsByTagName("head")[0],i=document.createElement("script");i.type="text/javascript",i.charset="utf-8",i.async=!0,i.timeout=12e4,n.nc&&i.setAttribute("nonce",n.nc),i.src=n.p+""+{0:"d1359b519c10df30787b",1:"06459c375ec851b0e2ae",2:"4d752abc2fcf569f13fc",3:"8d8564a703e7631bff4b"}[e]+".js";var a=setTimeout(r,12e4);return i.onerror=i.onload=r,u.appendChild(i),t},n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},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,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="js/",n.oe=function(e){throw console.error(e),e}}([]);
6666
</script>
6767

6868
<!-- optional when using the CommonChunkPlugin for vendor modules -->
@@ -144,13 +144,13 @@ __webpack_require__.e/* import() */(0).then(__webpack_require__.bind(null, /*! .
144144

145145
```
146146
Hash: ea635224271deb1b32d9
147-
Version: webpack 2.3.3
147+
Version: webpack 2.6.0
148148
Asset Size Chunks Chunk Names
149149
d1359b519c10df30787b.js 237 bytes 0 [emitted]
150150
06459c375ec851b0e2ae.js 243 bytes 1 [emitted]
151151
common.[chunkhash].js 747 bytes 2 [emitted] common
152152
main.[chunkhash].js 654 bytes 3 [emitted] main
153-
manifest.[chunkhash].js 5.88 kB 4 [emitted] manifest
153+
manifest.[chunkhash].js 6.05 kB 4 [emitted] manifest
154154
Entrypoint main = manifest.[chunkhash].js common.[chunkhash].js main.[chunkhash].js
155155
Entrypoint common = manifest.[chunkhash].js common.[chunkhash].js
156156
chunk {0} d1359b519c10df30787b.js 29 bytes {3} [rendered]
@@ -178,13 +178,13 @@ chunk {4} manifest.[chunkhash].js (manifest) 0 bytes [entry] [rendered]
178178

179179
```
180180
Hash: ea635224271deb1b32d9
181-
Version: webpack 2.3.3
181+
Version: webpack 2.6.0
182182
Asset Size Chunks Chunk Names
183183
d1359b519c10df30787b.js 38 bytes 0 [emitted]
184184
06459c375ec851b0e2ae.js 37 bytes 1 [emitted]
185185
common.[chunkhash].js 152 bytes 2 [emitted] common
186186
main.[chunkhash].js 166 bytes 3 [emitted] main
187-
manifest.[chunkhash].js 1.48 kB 4 [emitted] manifest
187+
manifest.[chunkhash].js 1.49 kB 4 [emitted] manifest
188188
Entrypoint main = manifest.[chunkhash].js common.[chunkhash].js main.[chunkhash].js
189189
Entrypoint common = manifest.[chunkhash].js common.[chunkhash].js
190190
chunk {0} d1359b519c10df30787b.js 29 bytes {3} [rendered]

examples/code-splitted-css-bundle/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ body {
6666
## Uncompressed
6767

6868
```
69-
Hash: 921f06e52b5748b2b7f9
70-
Version: webpack 2.3.2
69+
Hash: 2fbd8d3f44d15765df64
70+
Version: webpack 2.6.0
7171
Asset Size Chunks Chunk Names
7272
ce21cbdd9b894e6af794813eb3fdaf60.png 119 bytes [emitted]
7373
0.output.js 2.24 kB 0 [emitted]
74-
output.js 15.5 kB 1 [emitted] main
74+
output.js 15.4 kB 1 [emitted] main
7575
style.css 71 bytes 1 [emitted] main
7676
Entrypoint main = output.js style.css
7777
chunk {0} 0.output.js 1.25 kB {1} [rendered]
@@ -84,15 +84,15 @@ chunk {0} 0.output.js 1.25 kB {1} [rendered]
8484
cjs require ./style2.css [1] ./chunk.js 1:0-23
8585
[7] ./image2.png 82 bytes {0} [built]
8686
cjs require ./image2.png [5] (webpack)/~/css-loader!./style2.css 6:58-81
87-
chunk {1} output.js, style.css (main) 8.75 kB [entry] [rendered]
87+
chunk {1} output.js, style.css (main) 8.5 kB [entry] [rendered]
8888
> main [2] ./example.js
8989
[0] ./style.css 41 bytes {1} [built]
9090
cjs require ./style.css [2] ./example.js 1:0-22
9191
[2] ./example.js 48 bytes {1} [built]
9292
[3] (webpack)/~/css-loader/lib/css-base.js 1.51 kB {1} [built]
9393
cjs require ../../node_modules/css-loader/lib/css-base.js [5] (webpack)/~/css-loader!./style2.css 1:27-83
9494
cjs require ../../node_modules/css-loader/lib/css-base.js [8] (webpack)/~/css-loader!./style.css 1:27-83
95-
[4] (webpack)/~/style-loader/addStyles.js 7.15 kB {1} [built]
95+
[4] (webpack)/~/style-loader/addStyles.js 6.91 kB {1} [built]
9696
cjs require !../../node_modules/style-loader/addStyles.js [6] ./style2.css 7:13-69
9797
Child extract-text-webpack-plugin:
9898
Entrypoint undefined = extract-text-webpack-plugin-output-filename
@@ -108,12 +108,12 @@ Child extract-text-webpack-plugin:
108108
## Minimized (uglify-js, no zip)
109109

110110
```
111-
Hash: b832c58ce5b88806634b
112-
Version: webpack 2.3.2
111+
Hash: 4571a05f1dfd87276cbb
112+
Version: webpack 2.6.0
113113
Asset Size Chunks Chunk Names
114114
ce21cbdd9b894e6af794813eb3fdaf60.png 119 bytes [emitted]
115115
0.output.js 309 bytes 0 [emitted]
116-
output.js 5.02 kB 1 [emitted] main
116+
output.js 5.03 kB 1 [emitted] main
117117
style.css 61 bytes 1 [emitted] main
118118
Entrypoint main = output.js style.css
119119
chunk {0} 0.output.js 1.23 kB {1} [rendered]
@@ -126,15 +126,15 @@ chunk {0} 0.output.js 1.23 kB {1} [rendered]
126126
cjs require ./style2.css [1] ./chunk.js 1:0-23
127127
[7] ./image2.png 82 bytes {0} [built]
128128
cjs require ./image2.png [5] (webpack)/~/css-loader!./style2.css 6:50-73
129-
chunk {1} output.js, style.css (main) 8.75 kB [entry] [rendered]
129+
chunk {1} output.js, style.css (main) 8.5 kB [entry] [rendered]
130130
> main [2] ./example.js
131131
[0] ./style.css 41 bytes {1} [built]
132132
cjs require ./style.css [2] ./example.js 1:0-22
133133
[2] ./example.js 48 bytes {1} [built]
134134
[3] (webpack)/~/css-loader/lib/css-base.js 1.51 kB {1} [built]
135135
cjs require ../../node_modules/css-loader/lib/css-base.js [5] (webpack)/~/css-loader!./style2.css 1:27-83
136136
cjs require ../../node_modules/css-loader/lib/css-base.js [8] (webpack)/~/css-loader!./style.css 1:27-83
137-
[4] (webpack)/~/style-loader/addStyles.js 7.15 kB {1} [built]
137+
[4] (webpack)/~/style-loader/addStyles.js 6.91 kB {1} [built]
138138
cjs require !../../node_modules/style-loader/addStyles.js [6] ./style2.css 7:13-69
139139
Child extract-text-webpack-plugin:
140140
Entrypoint undefined = extract-text-webpack-plugin-output-filename

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

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ getTemplate("b", function(b) {
2828
/******/ var moduleId, chunkId, i = 0, resolves = [], result;
2929
/******/ for(;i < chunkIds.length; i++) {
3030
/******/ chunkId = chunkIds[i];
31-
/******/ if(installedChunks[chunkId])
31+
/******/ if(installedChunks[chunkId]) {
3232
/******/ resolves.push(installedChunks[chunkId][0]);
33+
/******/ }
3334
/******/ installedChunks[chunkId] = 0;
3435
/******/ }
3536
/******/ for(moduleId in moreModules) {
@@ -38,8 +39,9 @@ getTemplate("b", function(b) {
3839
/******/ }
3940
/******/ }
4041
/******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);
41-
/******/ while(resolves.length)
42+
/******/ while(resolves.length) {
4243
/******/ resolves.shift()();
44+
/******/ }
4345
/******/
4446
/******/ };
4547
/******/
@@ -51,13 +53,15 @@ getTemplate("b", function(b) {
5153
/******/ 1: 0
5254
/******/ };
5355
/******/
56+
/******/ var resolvedPromise = new Promise(function(resolve) { resolve(); });
57+
/******/
5458
/******/ // The require function
5559
/******/ function __webpack_require__(moduleId) {
5660
/******/
5761
/******/ // Check if module is in cache
58-
/******/ if(installedModules[moduleId])
62+
/******/ if(installedModules[moduleId]) {
5963
/******/ return installedModules[moduleId].exports;
60-
/******/
64+
/******/ }
6165
/******/ // Create a new module (and put it into the cache)
6266
/******/ var module = installedModules[moduleId] = {
6367
/******/ i: moduleId,
@@ -78,8 +82,9 @@ getTemplate("b", function(b) {
7882
/******/ // This file contains only the entry chunk.
7983
/******/ // The chunk loading function for additional chunks
8084
/******/ __webpack_require__.e = function requireEnsure(chunkId) {
81-
/******/ if(installedChunks[chunkId] === 0)
82-
/******/ return Promise.resolve();
85+
/******/ if(installedChunks[chunkId] === 0) {
86+
/******/ return resolvedPromise;
87+
/******/ }
8388
/******/
8489
/******/ // a Promise means "currently loading".
8590
/******/ if(installedChunks[chunkId]) {
@@ -112,7 +117,9 @@ getTemplate("b", function(b) {
112117
/******/ clearTimeout(timeout);
113118
/******/ var chunk = installedChunks[chunkId];
114119
/******/ if(chunk !== 0) {
115-
/******/ if(chunk) chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));
120+
/******/ if(chunk) {
121+
/******/ chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));
122+
/******/ }
116123
/******/ installedChunks[chunkId] = undefined;
117124
/******/ }
118125
/******/ };
@@ -279,10 +286,10 @@ module.exports = function() {
279286

280287
```
281288
Hash: 1c46bbe47e8b8a0ee8e2
282-
Version: webpack 2.3.2
289+
Version: webpack 2.6.0
283290
Asset Size Chunks Chunk Names
284291
0.output.js 1.85 kB 0 [emitted]
285-
output.js 6.36 kB 1 [emitted] main
292+
output.js 6.53 kB 1 [emitted] main
286293
Entrypoint main = output.js
287294
chunk {0} 0.output.js 463 bytes {1} [rendered]
288295
> [0] ./example.js 2:1-4:3
@@ -306,10 +313,10 @@ chunk {1} output.js (main) 261 bytes [entry] [rendered]
306313

307314
```
308315
Hash: 1c46bbe47e8b8a0ee8e2
309-
Version: webpack 2.3.2
316+
Version: webpack 2.6.0
310317
Asset Size Chunks Chunk Names
311318
0.output.js 544 bytes 0 [emitted]
312-
output.js 1.54 kB 1 [emitted] main
319+
output.js 1.55 kB 1 [emitted] main
313320
Entrypoint main = output.js
314321
chunk {0} 0.output.js 463 bytes {1} [rendered]
315322
> [0] ./example.js 2:1-4:3

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

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ getTemplate("b", function(b) {
2828
/******/ var moduleId, chunkId, i = 0, resolves = [], result;
2929
/******/ for(;i < chunkIds.length; i++) {
3030
/******/ chunkId = chunkIds[i];
31-
/******/ if(installedChunks[chunkId])
31+
/******/ if(installedChunks[chunkId]) {
3232
/******/ resolves.push(installedChunks[chunkId][0]);
33+
/******/ }
3334
/******/ installedChunks[chunkId] = 0;
3435
/******/ }
3536
/******/ for(moduleId in moreModules) {
@@ -38,8 +39,9 @@ getTemplate("b", function(b) {
3839
/******/ }
3940
/******/ }
4041
/******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);
41-
/******/ while(resolves.length)
42+
/******/ while(resolves.length) {
4243
/******/ resolves.shift()();
44+
/******/ }
4345
/******/
4446
/******/ };
4547
/******/
@@ -51,13 +53,15 @@ getTemplate("b", function(b) {
5153
/******/ 1: 0
5254
/******/ };
5355
/******/
56+
/******/ var resolvedPromise = new Promise(function(resolve) { resolve(); });
57+
/******/
5458
/******/ // The require function
5559
/******/ function __webpack_require__(moduleId) {
5660
/******/
5761
/******/ // Check if module is in cache
58-
/******/ if(installedModules[moduleId])
62+
/******/ if(installedModules[moduleId]) {
5963
/******/ return installedModules[moduleId].exports;
60-
/******/
64+
/******/ }
6165
/******/ // Create a new module (and put it into the cache)
6266
/******/ var module = installedModules[moduleId] = {
6367
/******/ i: moduleId,
@@ -78,8 +82,9 @@ getTemplate("b", function(b) {
7882
/******/ // This file contains only the entry chunk.
7983
/******/ // The chunk loading function for additional chunks
8084
/******/ __webpack_require__.e = function requireEnsure(chunkId) {
81-
/******/ if(installedChunks[chunkId] === 0)
82-
/******/ return Promise.resolve();
85+
/******/ if(installedChunks[chunkId] === 0) {
86+
/******/ return resolvedPromise;
87+
/******/ }
8388
/******/
8489
/******/ // a Promise means "currently loading".
8590
/******/ if(installedChunks[chunkId]) {
@@ -112,7 +117,9 @@ getTemplate("b", function(b) {
112117
/******/ clearTimeout(timeout);
113118
/******/ var chunk = installedChunks[chunkId];
114119
/******/ if(chunk !== 0) {
115-
/******/ if(chunk) chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));
120+
/******/ if(chunk) {
121+
/******/ chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));
122+
/******/ }
116123
/******/ installedChunks[chunkId] = undefined;
117124
/******/ }
118125
/******/ };
@@ -279,10 +286,10 @@ module.exports = function() {
279286

280287
```
281288
Hash: f67ab883501eec17d2fb
282-
Version: webpack 2.3.2
289+
Version: webpack 2.6.0
283290
Asset Size Chunks Chunk Names
284291
0.output.js 1.85 kB 0 [emitted]
285-
output.js 6.3 kB 1 [emitted] main
292+
output.js 6.46 kB 1 [emitted] main
286293
Entrypoint main = output.js
287294
chunk {0} 0.output.js 463 bytes {1} [rendered]
288295
> [0] ./example.js 2:1-4:3
@@ -306,10 +313,10 @@ chunk {1} output.js (main) 276 bytes [entry] [rendered]
306313

307314
```
308315
Hash: f67ab883501eec17d2fb
309-
Version: webpack 2.3.2
316+
Version: webpack 2.6.0
310317
Asset Size Chunks Chunk Names
311318
0.output.js 544 bytes 0 [emitted]
312-
output.js 1.51 kB 1 [emitted] main
319+
output.js 1.52 kB 1 [emitted] main
313320
Entrypoint main = output.js
314321
chunk {0} 0.output.js 463 bytes {1} [rendered]
315322
> [0] ./example.js 2:1-4:3

0 commit comments

Comments
 (0)