Skip to content

Commit 0d98763

Browse files
committed
update examples
1 parent 90068d8 commit 0d98763

File tree

7 files changed

+30
-204
lines changed

7 files changed

+30
-204
lines changed

examples/chunkhash/README.md

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

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

6969
<!-- optional when using the CommonChunkPlugin for vendor modules -->
@@ -146,7 +146,7 @@ Version: webpack next
146146
common.[chunkhash].js 727 bytes 1 [emitted] common
147147
b71c088662b7b530c545.js 264 bytes 2 [emitted]
148148
f6eb6a4d15b19e593a54.js 264 bytes 3 [emitted]
149-
manifest.[chunkhash].js 7.16 KiB 4 [emitted] manifest
149+
manifest.[chunkhash].js 7.1 KiB 4 [emitted] manifest
150150
Entrypoint main = manifest.[chunkhash].js common.[chunkhash].js main.[chunkhash].js
151151
Entrypoint common = manifest.[chunkhash].js common.[chunkhash].js
152152
chunk {0} main.[chunkhash].js (main) 90 bytes {1} [initial] [rendered]
@@ -183,7 +183,7 @@ Version: webpack next
183183
4f0e85908244254bb448.js 78 bytes 1 [emitted]
184184
common.[chunkhash].js 153 bytes 2 [emitted] common
185185
main.[chunkhash].js 300 bytes 3 [emitted] main
186-
manifest.[chunkhash].js 1.81 KiB 4 [emitted] manifest
186+
manifest.[chunkhash].js 1.76 KiB 4 [emitted] manifest
187187
Entrypoint main = manifest.[chunkhash].js common.[chunkhash].js main.[chunkhash].js
188188
Entrypoint common = manifest.[chunkhash].js common.[chunkhash].js
189189
chunk {0} 19a84e789378731c8460.js 29 bytes {3} [rendered]

examples/common-chunk-and-vendor-chunk/README.md

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -140,64 +140,6 @@ module.exports = {
140140
/******/ return module.exports;
141141
/******/ }
142142
/******/
143-
/******/ // This file contains only the entry chunk.
144-
/******/ // The chunk loading function for additional chunks
145-
/******/ __webpack_require__.e = function requireEnsure(chunkId) {
146-
/******/ var promises = [];
147-
/******/
148-
/******/
149-
/******/ // JSONP chunk loading for javascript
150-
/******/
151-
/******/ var installedChunkData = installedChunks[chunkId];
152-
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
153-
/******/
154-
/******/ // a Promise means "currently loading".
155-
/******/ if(installedChunkData) {
156-
/******/ promises.push(installedChunkData[2]);
157-
/******/ } else {
158-
/******/ // setup Promise in chunk cache
159-
/******/ var promise = new Promise(function(resolve, reject) {
160-
/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
161-
/******/ });
162-
/******/ promises.push(installedChunkData[2] = promise);
163-
/******/
164-
/******/ // start chunk loading
165-
/******/ var head = document.getElementsByTagName('head')[0];
166-
/******/ var script = document.createElement('script');
167-
/******/
168-
/******/ script.charset = 'utf-8';
169-
/******/ script.timeout = 120000;
170-
/******/
171-
/******/ if (__webpack_require__.nc) {
172-
/******/ script.setAttribute("nonce", __webpack_require__.nc);
173-
/******/ }
174-
/******/ script.src = __webpack_require__.p + "" + chunkId + ".js";
175-
/******/ var timeout = setTimeout(function(){
176-
/******/ onScriptComplete({ type: 'timeout', target: script });
177-
/******/ }, 120000);
178-
/******/ script.onerror = script.onload = onScriptComplete;
179-
/******/ function onScriptComplete(event) {
180-
/******/ // avoid mem leaks in IE.
181-
/******/ script.onerror = script.onload = null;
182-
/******/ clearTimeout(timeout);
183-
/******/ var chunk = installedChunks[chunkId];
184-
/******/ if(chunk !== 0) {
185-
/******/ if(chunk) {
186-
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
187-
/******/ var realSrc = event && event.target && event.target.src;
188-
/******/ var error = new Error('Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')');
189-
/******/ error.type = errorType;
190-
/******/ error.request = realSrc;
191-
/******/ chunk[1](error);
192-
/******/ }
193-
/******/ installedChunks[chunkId] = undefined;
194-
/******/ }
195-
/******/ };
196-
/******/ head.appendChild(script);
197-
/******/ }
198-
/******/ }
199-
/******/ return Promise.all(promises);
200-
/******/ };
201143
/******/
202144
/******/ // expose the modules object (__webpack_modules__)
203145
/******/ __webpack_require__.m = modules;
@@ -405,7 +347,7 @@ module.exports = "pageC";
405347
Hash: 0a1b2c3d4e5f6a7b8c9d
406348
Version: webpack next
407349
Asset Size Chunks Chunk Names
408-
vendor.js 7.86 KiB 0 [emitted] vendor
350+
vendor.js 5.47 KiB 0 [emitted] vendor
409351
pageA.js 627 bytes 1 [emitted] pageA
410352
pageB.js 408 bytes 2 [emitted] pageB
411353
pageC.js 408 bytes 3 [emitted] pageC
@@ -456,7 +398,7 @@ common.js 132 bytes 0 [emitted] common
456398
pageC.js 119 bytes 1 [emitted] pageC
457399
pageB.js 119 bytes 2 [emitted] pageB
458400
pageA.js 157 bytes 3 [emitted] pageA
459-
vendor.js 1.83 KiB 4 [emitted] vendor
401+
vendor.js 1.17 KiB 4 [emitted] vendor
460402
Entrypoint vendor = vendor.js
461403
Entrypoint pageA = vendor.js common.js pageA.js
462404
Entrypoint pageB = vendor.js common.js pageB.js

examples/explicit-vendor-chunk/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = [
1616
plugins: [
1717
new webpack.DllPlugin({
1818
name: "vendor_[hash]",
19-
path: path.resolve(__dirname, "js/manifest.json")
19+
path: path.resolve(__dirname, "dist/manifest.json")
2020
})
2121
]
2222
},
@@ -35,7 +35,7 @@ module.exports = [
3535
},
3636
plugins: [
3737
new webpack.DllReferencePlugin({
38-
manifest: path.resolve(__dirname, "js/manifest.json")
38+
manifest: path.resolve(__dirname, "dist/manifest.json")
3939
})
4040
]
4141
}

examples/multiple-commons-chunks/README.md

Lines changed: 4 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -154,64 +154,6 @@ module.exports = {
154154
/******/ return module.exports;
155155
/******/ }
156156
/******/
157-
/******/ // This file contains only the entry chunk.
158-
/******/ // The chunk loading function for additional chunks
159-
/******/ __webpack_require__.e = function requireEnsure(chunkId) {
160-
/******/ var promises = [];
161-
/******/
162-
/******/
163-
/******/ // JSONP chunk loading for javascript
164-
/******/
165-
/******/ var installedChunkData = installedChunks[chunkId];
166-
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
167-
/******/
168-
/******/ // a Promise means "currently loading".
169-
/******/ if(installedChunkData) {
170-
/******/ promises.push(installedChunkData[2]);
171-
/******/ } else {
172-
/******/ // setup Promise in chunk cache
173-
/******/ var promise = new Promise(function(resolve, reject) {
174-
/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
175-
/******/ });
176-
/******/ promises.push(installedChunkData[2] = promise);
177-
/******/
178-
/******/ // start chunk loading
179-
/******/ var head = document.getElementsByTagName('head')[0];
180-
/******/ var script = document.createElement('script');
181-
/******/
182-
/******/ script.charset = 'utf-8';
183-
/******/ script.timeout = 120000;
184-
/******/
185-
/******/ if (__webpack_require__.nc) {
186-
/******/ script.setAttribute("nonce", __webpack_require__.nc);
187-
/******/ }
188-
/******/ script.src = __webpack_require__.p + "" + chunkId + ".js";
189-
/******/ var timeout = setTimeout(function(){
190-
/******/ onScriptComplete({ type: 'timeout', target: script });
191-
/******/ }, 120000);
192-
/******/ script.onerror = script.onload = onScriptComplete;
193-
/******/ function onScriptComplete(event) {
194-
/******/ // avoid mem leaks in IE.
195-
/******/ script.onerror = script.onload = null;
196-
/******/ clearTimeout(timeout);
197-
/******/ var chunk = installedChunks[chunkId];
198-
/******/ if(chunk !== 0) {
199-
/******/ if(chunk) {
200-
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
201-
/******/ var realSrc = event && event.target && event.target.src;
202-
/******/ var error = new Error('Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')');
203-
/******/ error.type = errorType;
204-
/******/ error.request = realSrc;
205-
/******/ chunk[1](error);
206-
/******/ }
207-
/******/ installedChunks[chunkId] = undefined;
208-
/******/ }
209-
/******/ };
210-
/******/ head.appendChild(script);
211-
/******/ }
212-
/******/ }
213-
/******/ return Promise.all(promises);
214-
/******/ };
215157
/******/
216158
/******/ // expose the modules object (__webpack_modules__)
217159
/******/ __webpack_require__.m = modules;
@@ -376,8 +318,8 @@ Version: webpack next
376318
adminPageB.js 374 bytes 4 [emitted] adminPageB
377319
adminPageC.js 558 bytes 5 [emitted] adminPageC
378320
admin-commons.js 256 bytes 6 [emitted] admin-commons
379-
commons.js 7.41 KiB 7 [emitted] commons
380-
c-commons.js 7.24 KiB 8 [emitted] c-commons
321+
commons.js 5.03 KiB 7 [emitted] commons
322+
c-commons.js 4.85 KiB 8 [emitted] c-commons
381323
Entrypoint pageA = commons.js pageA.js
382324
Entrypoint pageB = commons.js pageB.js
383325
Entrypoint pageC = c-commons.js pageC.js
@@ -463,8 +405,8 @@ admin-commons.js 77 bytes 0 [emitted] admin-commons
463405
pageC.js 140 bytes 4 [emitted] pageC
464406
pageB.js 122 bytes 5 [emitted] pageB
465407
pageA.js 124 bytes 6 [emitted] pageA
466-
c-commons.js 1.72 KiB 7 [emitted] c-commons
467-
commons.js 1.74 KiB 8, 7 [emitted] commons
408+
c-commons.js 1.06 KiB 7 [emitted] c-commons
409+
commons.js 1.08 KiB 8, 7 [emitted] commons
468410
Entrypoint pageA = commons.js pageA.js
469411
Entrypoint pageB = commons.js pageB.js
470412
Entrypoint pageC = c-commons.js pageC.js

examples/multiple-entry-points-commons-chunk-css-bundle/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ c2a2f62d69330b7d787782f5010f9d13.png 120 bytes [emitted]
200200
A.js 547 bytes 0 [emitted] A
201201
B.js 551 bytes 1 [emitted] B
202202
16155c689e517682064c99893cb832cc.png 120 bytes [emitted]
203-
commons.js 7.26 KiB 3 [emitted] commons
203+
commons.js 4.87 KiB 3 [emitted] commons
204204
A.css 71 bytes 0 [emitted] A
205205
B.css 71 bytes 1 [emitted] B
206206
C.css 144 bytes 2 [emitted] C
@@ -277,7 +277,7 @@ Child extract-text-webpack-plugin ../../node_modules/extract-text-webpack-plugin
277277
Hash: 0a1b2c3d4e5f6a7b8c9d
278278
Version: webpack next
279279
Asset Size Chunks Chunk Names
280-
commons.js 1.72 KiB 2 [emitted] commons
280+
commons.js 1.06 KiB 2 [emitted] commons
281281
d090b6fba0f6d326d282a19146ff54a7.png 120 bytes [emitted]
282282
ce21cbdd9b894e6af794813eb3fdaf60.png 119 bytes [emitted]
283283
c2a2f62d69330b7d787782f5010f9d13.png 120 bytes [emitted]

0 commit comments

Comments
 (0)