Skip to content

Commit cb3d8e2

Browse files
committed
updated examples
1 parent d900e7d commit cb3d8e2

File tree

39 files changed

+1686
-1476
lines changed

39 files changed

+1686
-1476
lines changed

examples/agressive-merging/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ module.exports = {
5858
```
5959
Hash: 042a9d90b141419e1b34
6060
Version: webpack 2.0.6-beta
61-
Time: 112ms
61+
Time: 116ms
6262
Asset Size Chunks Chunk Names
6363
0.chunk.js 5.72 kB 0 [emitted]
6464
pageB.bundle.js 4.72 kB 1 [emitted] pageB
65-
pageA.bundle.js 4.68 kB 2 [emitted] pageA
65+
pageA.bundle.js 4.69 kB 2 [emitted] pageA
6666
3.chunk.js 291 bytes 3 [emitted]
67-
pageC.bundle.js 4.53 kB 4 [emitted] pageC
67+
pageC.bundle.js 4.54 kB 4 [emitted] pageC
6868
chunk {0} 0.chunk.js 5.55 kB {2} {1} [rendered]
6969
> [3] ./pageA.js 1:0-3:2
7070
> aggressive-merge [4] ./pageB.js 1:0-3:2
@@ -101,7 +101,7 @@ chunk {4} pageC.bundle.js (pageC) 70 bytes [rendered]
101101
```
102102
Hash: 042a9d90b141419e1b34
103103
Version: webpack 2.0.6-beta
104-
Time: 565ms
104+
Time: 317ms
105105
Asset Size Chunks Chunk Names
106106
0.chunk.js 75 bytes 0 [emitted]
107107
pageB.bundle.js 1.1 kB 1 [emitted] pageB

examples/chunkhash/README.md

Lines changed: 3 additions & 3 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(o){if(n[o])return n[o].exports;var t=n[o]={exports:{},id:o,loaded:!1};return e[o].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}var o=window.webpackJsonp;window.webpackJsonp=function(n,a,c){for(var i,d,f=0,u=[];f<n.length;f++)d=n[f],t[d]&&u.push(t[d][0]),t[d]=0;for(i in a)e[i]=a[i];for(o&&o(n,a);u.length;)u.shift()();return c+1?r(c):void 0};var n={},t={2:0};r.e=function(e){function o(){a.onerror=a.onload=null,clearTimeout(c);var r=t[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}if(0===t[e])return Promise.resolve();if(t[e])return t[e][2];var n=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,a.src=r.p+""+{0:"27ffa809c94fb1e509c5",1:"8925d45ed07a265d4246",3:"f2764945b8b62e30c662",4:"bcb99dbc93c7f755b2df"}[e]+".js";var c=setTimeout(o,12e4);a.onerror=a.onload=o,n.appendChild(a);var i=new Promise(function(r,o){t[e]=[r,o]});return t[e][2]=i},r.m=e,r.c=n,r.oe=function(e){throw e},r.p="js/"}([]);
65+
!function(e){function r(o){if(n[o])return n[o].exports;var t=n[o]={exports:{},id:o,loaded:!1};return e[o].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}var o=window.webpackJsonp;window.webpackJsonp=function(n,a,c){for(var i,d,f=0,u=[];f<n.length;f++)d=n[f],t[d]&&u.push(t[d][0]),t[d]=0;for(i in a)e[i]=a[i];for(o&&o(n,a);u.length;)u.shift()();return c+1?r(c):void 0};var n={},t={2:0};r.e=function(e){function o(){a.onerror=a.onload=null,clearTimeout(c);var r=t[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}if(0===t[e])return Promise.resolve();if(t[e])return t[e][2];var n=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,a.src=r.p+""+{0:"27ffa809c94fb1e509c5",1:"8925d45ed07a265d4246",3:"f2764945b8b62e30c662",4:"bcb99dbc93c7f755b2df"}[e]+".js";var c=setTimeout(o,12e4);a.onerror=a.onload=o,n.appendChild(a);var i=new Promise(function(r,o){t[e]=[r,o]});return t[e][2]=i},r.m=e,r.c=n,r.p="js/",r.oe=function(e){throw e}}([]);
6666
</script>
6767

6868
<!-- optional when using the CommonChunkPlugin for vendor modules -->
@@ -135,7 +135,7 @@ webpackJsonp([4,2],{
135135
```
136136
Hash: e8b4a7834dca40744042
137137
Version: webpack 2.0.6-beta
138-
Time: 91ms
138+
Time: 118ms
139139
Asset Size Chunks Chunk Names
140140
27ffa809c94fb1e509c5.js 184 bytes 0, 2 [emitted]
141141
8925d45ed07a265d4246.js 190 bytes 1, 2 [emitted]
@@ -167,7 +167,7 @@ chunk {4} main.chunkhash.js (main) 104 bytes {3} [rendered]
167167
```
168168
Hash: e8b4a7834dca40744042
169169
Version: webpack 2.0.6-beta
170-
Time: 231ms
170+
Time: 176ms
171171
Asset Size Chunks Chunk Names
172172
27ffa809c94fb1e509c5.js 40 bytes 0, 2 [emitted]
173173
8925d45ed07a265d4246.js 39 bytes 1, 2 [emitted]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ body {
6363
```
6464
Hash: c9ce445a69a479e2ac91
6565
Version: webpack 2.0.6-beta
66-
Time: 1261ms
66+
Time: 759ms
6767
Asset Size Chunks Chunk Names
6868
ce21cbdd9b894e6af794813eb3fdaf60.png 119 bytes [emitted]
6969
output.js 14 kB 0 [emitted] main
@@ -104,7 +104,7 @@ Child extract-text-webpack-plugin:
104104
```
105105
Hash: 8d2a516760eae1b74b56
106106
Version: webpack 2.0.6-beta
107-
Time: 1598ms
107+
Time: 1138ms
108108
Asset Size Chunks Chunk Names
109109
ce21cbdd9b894e6af794813eb3fdaf60.png 119 bytes [emitted]
110110
output.js 4.71 kB 0 [emitted] main

examples/code-splitted-dedupe/README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,12 @@ require(["../dedupe/b"]);
133133
/******/ // expose the module cache
134134
/******/ __webpack_require__.c = installedModules;
135135

136+
/******/ // __webpack_public_path__
137+
/******/ __webpack_require__.p = "js/";
138+
136139
/******/ // on error function for async loading
137140
/******/ __webpack_require__.oe = function(err) { throw err; };
138141

139-
/******/ // __webpack_public_path__
140-
/******/ __webpack_require__.p = "js/";
141142
/******/ // Load entry module and return exports
142143
/******/ return __webpack_require__(__webpack_require__.s = 2);
143144
/******/ })
@@ -174,11 +175,11 @@ require(["../dedupe/b"]);
174175
/***/ function(module, exports, __webpack_require__) {
175176

176177
// index.js and x.js can be deduplicated
177-
__webpack_require__.e/* require */(0).then(function() {[__webpack_require__(/*! ../dedupe/a */ 0), __webpack_require__(/*! bundle?lazy!../dedupe/b */ 3)];}).catch(function(err) { __webpack_require__.oe(err); });
178+
__webpack_require__.e/* require */(0).catch(function(err) { __webpack_require__.oe(err); }).then(function() {[__webpack_require__(/*! ../dedupe/a */ 0), __webpack_require__(/*! bundle?lazy!../dedupe/b */ 3)];});
178179

179180
// index.js and x.js cannot be deduplicated
180-
__webpack_require__.e/* require */(2).then(function() {[__webpack_require__(/*! ../dedupe/a */ 0)];}).catch(function(err) { __webpack_require__.oe(err); });
181-
__webpack_require__.e/* require */(1).then(function() {[__webpack_require__(/*! ../dedupe/b */ 1)];}).catch(function(err) { __webpack_require__.oe(err); });
181+
__webpack_require__.e/* require */(2).catch(function(err) { __webpack_require__.oe(err); }).then(function() {[__webpack_require__(/*! ../dedupe/a */ 0)];});
182+
__webpack_require__.e/* require */(1).catch(function(err) { __webpack_require__.oe(err); }).then(function() {[__webpack_require__(/*! ../dedupe/b */ 1)];});
182183

183184

184185
/***/ }
@@ -204,9 +205,9 @@ webpackJsonp([0,2],[
204205
/***/ function(module, exports, __webpack_require__) {
205206

206207
module.exports = function(cb) {
207-
__webpack_require__.e/* nsure */(4).then(function(require) {
208+
__webpack_require__.e/* nsure */(4).catch(function(err) { __webpack_require__.oe(err); }).then(function(require) {
208209
cb(__webpack_require__(/*! !./index.js */ 1));
209-
}.bind(null, __webpack_require__)).catch(function(err) { __webpack_require__.oe(err); });
210+
}.bind(null, __webpack_require__));
210211
}
211212

212213
/***/ },
@@ -394,7 +395,7 @@ webpackJsonp([4],{
394395
```
395396
Hash: 16906a1f14360b9ac9e8
396397
Version: webpack 2.0.6-beta
397-
Time: 151ms
398+
Time: 170ms
398399
Asset Size Chunks Chunk Names
399400
0.js 1.71 kB 0, 2 [emitted]
400401
1.js 933 bytes 1, 4 [emitted]
@@ -461,7 +462,7 @@ chunk {4} 4.js 167 bytes {0} [rendered]
461462
```
462463
Hash: 16906a1f14360b9ac9e8
463464
Version: webpack 2.0.6-beta
464-
Time: 402ms
465+
Time: 291ms
465466
Asset Size Chunks Chunk Names
466467
0.js 342 bytes 0, 2 [emitted]
467468
1.js 213 bytes 1, 4 [emitted]

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,12 @@ getTemplate("b", function(b) {
116116
/******/ // expose the module cache
117117
/******/ __webpack_require__.c = installedModules;
118118

119+
/******/ // __webpack_public_path__
120+
/******/ __webpack_require__.p = "js/";
121+
119122
/******/ // on error function for async loading
120123
/******/ __webpack_require__.oe = function(err) { throw err; };
121124

122-
/******/ // __webpack_public_path__
123-
/******/ __webpack_require__.p = "js/";
124125
/******/ // Load entry module and return exports
125126
/******/ return __webpack_require__(__webpack_require__.s = 0);
126127
/******/ })
@@ -133,9 +134,9 @@ getTemplate("b", function(b) {
133134
/***/ function(module, exports, __webpack_require__) {
134135

135136
function getTemplate(templateName, callback) {
136-
__webpack_require__.e/* require */(0).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(/*! ../require.context/templates */ 1)("./"+templateName)]; (function(tmpl) {
137+
__webpack_require__.e/* require */(0).catch(function(err) { __webpack_require__.oe(err); }).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(/*! ../require.context/templates */ 1)("./"+templateName)]; (function(tmpl) {
137138
callback(tmpl());
138-
}.apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}).catch(function(err) { __webpack_require__.oe(err); });
139+
}.apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));});
139140
}
140141
getTemplate("a", function(a) {
141142
console.log(a);
@@ -228,7 +229,7 @@ webpackJsonp([0],[
228229
```
229230
Hash: 55b93949150554c7414b
230231
Version: webpack 2.0.6-beta
231-
Time: 102ms
232+
Time: 103ms
232233
Asset Size Chunks Chunk Names
233234
0.js 1.65 kB 0 [emitted]
234235
output.js 4.72 kB 1 [emitted] main
@@ -255,7 +256,7 @@ chunk {1} output.js (main) 261 bytes [rendered]
255256
```
256257
Hash: 55b93949150554c7414b
257258
Version: webpack 2.0.6-beta
258-
Time: 228ms
259+
Time: 265ms
259260
Asset Size Chunks Chunk Names
260261
0.js 544 bytes 0 [emitted]
261262
output.js 1.16 kB 1 [emitted] main

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,12 @@ getTemplate("b", function(b) {
116116
/******/ // expose the module cache
117117
/******/ __webpack_require__.c = installedModules;
118118

119+
/******/ // __webpack_public_path__
120+
/******/ __webpack_require__.p = "js/";
121+
119122
/******/ // on error function for async loading
120123
/******/ __webpack_require__.oe = function(err) { throw err; };
121124

122-
/******/ // __webpack_public_path__
123-
/******/ __webpack_require__.p = "js/";
124125
/******/ // Load entry module and return exports
125126
/******/ return __webpack_require__(__webpack_require__.s = 0);
126127
/******/ })
@@ -133,9 +134,9 @@ getTemplate("b", function(b) {
133134
/***/ function(module, exports, __webpack_require__) {
134135

135136
function getTemplate(templateName, callback) {
136-
__webpack_require__.e/* nsure */(0).then(function(require) {
137+
__webpack_require__.e/* nsure */(0).catch(function(err) { __webpack_require__.oe(err); }).then(function(require) {
137138
callback(__webpack_require__(/*! ../require.context/templates */ 1)("./"+templateName)());
138-
}.bind(null, __webpack_require__)).catch(function(err) { __webpack_require__.oe(err); });
139+
}.bind(null, __webpack_require__));
139140
}
140141
getTemplate("a", function(a) {
141142
console.log(a);
@@ -228,10 +229,10 @@ webpackJsonp([0],[
228229
```
229230
Hash: 960f23ddeec29787cc42
230231
Version: webpack 2.0.6-beta
231-
Time: 101ms
232+
Time: 99ms
232233
Asset Size Chunks Chunk Names
233234
0.js 1.65 kB 0 [emitted]
234-
output.js 4.64 kB 1 [emitted] main
235+
output.js 4.65 kB 1 [emitted] main
235236
chunk {0} 0.js 463 bytes {1} [rendered]
236237
> [0] ./example.js 2:1-4:3
237238
[1] ../require.context/templates ^\.\/.*$ 217 bytes {0} [built]
@@ -255,7 +256,7 @@ chunk {1} output.js (main) 276 bytes [rendered]
255256
```
256257
Hash: 960f23ddeec29787cc42
257258
Version: webpack 2.0.6-beta
258-
Time: 302ms
259+
Time: 165ms
259260
Asset Size Chunks Chunk Names
260261
0.js 544 bytes 0 [emitted]
261262
output.js 1.14 kB 1 [emitted] main

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,12 @@ module.exports = "It works";
119119
/******/ // expose the module cache
120120
/******/ __webpack_require__.c = installedModules;
121121

122+
/******/ // __webpack_public_path__
123+
/******/ __webpack_require__.p = "js/";
124+
122125
/******/ // on error function for async loading
123126
/******/ __webpack_require__.oe = function(err) { throw err; };
124127

125-
/******/ // __webpack_public_path__
126-
/******/ __webpack_require__.p = "js/";
127128
/******/ // Load entry module and return exports
128129
/******/ return __webpack_require__(__webpack_require__.s = 1);
129130
/******/ })
@@ -141,14 +142,14 @@ module.exports = "It works";
141142
if(cbs) cbs.push(cb);
142143
else cb(data);
143144
}
144-
__webpack_require__.e/* nsure */(1).then(function(require) {
145+
__webpack_require__.e/* nsure */(1).catch(function(err) { __webpack_require__.oe(err); }).then(function(require) {
145146
data = __webpack_require__(/*! !./file.js */ 2);
146147
var callbacks = cbs;
147148
cbs = null;
148149
for(var i = 0, l = callbacks.length; i < l; i++) {
149150
callbacks[i](data);
150151
}
151-
}.bind(null, __webpack_require__)).catch(function(err) { __webpack_require__.oe(err); });
152+
}.bind(null, __webpack_require__));
152153

153154
/***/ },
154155
/* 1 */
@@ -190,7 +191,7 @@ webpackJsonp([1],{
190191
```
191192
Hash: 5e83b5be2cdc348222db
192193
Version: webpack 2.0.6-beta
193-
Time: 112ms
194+
Time: 75ms
194195
Asset Size Chunks Chunk Names
195196
output.js 4.98 kB 0 [emitted] main
196197
1.js 175 bytes 1 [emitted]
@@ -210,7 +211,7 @@ chunk {1} 1.js 28 bytes {0} [rendered]
210211
```
211212
Hash: 5e83b5be2cdc348222db
212213
Version: webpack 2.0.6-beta
213-
Time: 235ms
214+
Time: 249ms
214215
Asset Size Chunks Chunk Names
215216
output.js 1.19 kB 0 [emitted] main
216217
1.js 58 bytes 1 [emitted]

examples/code-splitting-harmony/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,12 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) {
127127
/******/ // expose the module cache
128128
/******/ __webpack_require__.c = installedModules;
129129

130+
/******/ // __webpack_public_path__
131+
/******/ __webpack_require__.p = "js/";
132+
130133
/******/ // on error function for async loading
131134
/******/ __webpack_require__.oe = function(err) { throw err; };
132135

133-
/******/ // __webpack_public_path__
134-
/******/ __webpack_require__.p = "js/";
135136
/******/ // Load entry module and return exports
136137
/******/ return __webpack_require__(__webpack_require__.s = 4);
137138
/******/ })
@@ -255,7 +256,7 @@ chunk {3} 3.js 11 bytes {2} [rendered]
255256
```
256257
Hash: cefcab66a83c5000d38e
257258
Version: webpack 2.0.6-beta
258-
Time: 326ms
259+
Time: 239ms
259260
Asset Size Chunks Chunk Names
260261
0.js 38 bytes 0 [emitted]
261262
1.js 38 bytes 1 [emitted]

examples/code-splitting/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,12 @@ require.ensure(["c"], function(require) {
138138
/******/ // expose the module cache
139139
/******/ __webpack_require__.c = installedModules;
140140

141+
/******/ // __webpack_public_path__
142+
/******/ __webpack_require__.p = "js/";
143+
141144
/******/ // on error function for async loading
142145
/******/ __webpack_require__.oe = function(err) { throw err; };
143146

144-
/******/ // __webpack_public_path__
145-
/******/ __webpack_require__.p = "js/";
146147
/******/ // Load entry module and return exports
147148
/******/ return __webpack_require__(__webpack_require__.s = 2);
148149
/******/ })
@@ -174,10 +175,10 @@ require.ensure(["c"], function(require) {
174175

175176
var a = __webpack_require__(/*! a */ 1);
176177
var b = __webpack_require__(/*! b */ 0);
177-
__webpack_require__.e/* nsure */(1).then(function(require) {
178+
__webpack_require__.e/* nsure */(1).catch(function(err) { __webpack_require__.oe(err); }).then(function(require) {
178179
__webpack_require__(/*! b */ 0).xyz();
179180
var d = __webpack_require__(/*! d */ 4);
180-
}.bind(null, __webpack_require__)).catch(function(err) { __webpack_require__.oe(err); });
181+
}.bind(null, __webpack_require__));
181182

182183
/***/ }
183184
/******/ ]);
@@ -224,7 +225,7 @@ webpackJsonp([1],[,,,function(n,c){},function(n,c){}]);
224225
```
225226
Hash: 8c4d77ac26f67744ad74
226227
Version: webpack 2.0.6-beta
227-
Time: 112ms
228+
Time: 141ms
228229
Asset Size Chunks Chunk Names
229230
output.js 4.82 kB 0 [emitted] main
230231
1.js 310 bytes 1 [emitted]
@@ -249,7 +250,7 @@ chunk {1} 1.js 22 bytes {0} [rendered]
249250
```
250251
Hash: 8c4d77ac26f67744ad74
251252
Version: webpack 2.0.6-beta
252-
Time: 233ms
253+
Time: 214ms
253254
Asset Size Chunks Chunk Names
254255
output.js 1.09 kB 0 [emitted] main
255256
1.js 55 bytes 1 [emitted]

examples/coffee-script/README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,9 @@ module.exports = 42
6161
/******/ // expose the module cache
6262
/******/ __webpack_require__.c = installedModules;
6363

64-
/******/ // on error function for async loading
65-
/******/ __webpack_require__.oe = function(err) { throw err; };
66-
6764
/******/ // __webpack_public_path__
6865
/******/ __webpack_require__.p = "js/";
66+
6967
/******/ // Load entry module and return exports
7068
/******/ return __webpack_require__(__webpack_require__.s = 2);
7169
/******/ })
@@ -117,9 +115,9 @@ module.exports = 42
117115
```
118116
Hash: fa6a322e8d9b34546553
119117
Version: webpack 2.0.6-beta
120-
Time: 182ms
118+
Time: 178ms
121119
Asset Size Chunks Chunk Names
122-
output.js 2.19 kB 0 [emitted] main
120+
output.js 2.07 kB 0 [emitted] main
123121
chunk {0} output.js (main) 206 bytes [rendered]
124122
> main [2] ./example.js
125123
[0] ./cup2.coffee 57 bytes {0} [built]
@@ -135,9 +133,9 @@ chunk {0} output.js (main) 206 bytes [rendered]
135133
```
136134
Hash: fa6a322e8d9b34546553
137135
Version: webpack 2.0.6-beta
138-
Time: 255ms
136+
Time: 229ms
139137
Asset Size Chunks Chunk Names
140-
output.js 409 bytes 0 [emitted] main
138+
output.js 383 bytes 0 [emitted] main
141139
chunk {0} output.js (main) 206 bytes [rendered]
142140
> main [2] ./example.js
143141
[0] ./cup2.coffee 57 bytes {0} [built]

0 commit comments

Comments
 (0)