Skip to content

Commit 557d4af

Browse files
zhaoshengjunTheLarkInn
authored andcommitted
docs(example): update examples template (webpack#3074)
* docs(example): update examples template * docs(example): add npm script to build examples
1 parent 27a75aa commit 557d4af

46 files changed

Lines changed: 1613 additions & 1599 deletions

File tree

Some content is hidden

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

‎examples/agressive-merging/README.md‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,22 @@ module.exports = {
5656
## Uncompressed
5757

5858
```
59-
Hash: 06f18f1663d1b6555aff
60-
Version: webpack 2.1.0-beta.22
61-
Time: 169ms
59+
Hash: 06a73dcf91032a0ba5a5
60+
Version: webpack 2.1.0-beta.25
61+
Time: 147ms
6262
Asset Size Chunks Chunk Names
63-
0.chunk.js 5.76 kB 0 [emitted]
63+
0.chunk.js 5.75 kB 0 [emitted]
6464
1.chunk.js 397 bytes 1 [emitted]
6565
pageB.bundle.js 5.98 kB 2 [emitted] pageB
6666
pageA.bundle.js 5.95 kB 3 [emitted] pageA
6767
pageC.bundle.js 5.75 kB 4 [emitted] pageC
6868
Entrypoint pageA = pageA.bundle.js
6969
Entrypoint pageB = pageB.bundle.js
7070
Entrypoint pageC = pageC.bundle.js
71-
chunk {0} 0.chunk.js 5.55 kB {3} {2} [rendered]
71+
chunk {0} 0.chunk.js 5.54 kB {3} {2} [rendered]
7272
> aggressive-merge [3] ./pageA.js 1:0-3:2
7373
> aggressive-merge [4] ./pageB.js 1:0-3:2
74-
[2] ./common.js 5.55 kB {0} [built]
74+
[2] ./common.js 5.54 kB {0} [built]
7575
amd require ./common [3] ./pageA.js 1:0-3:2
7676
amd require ./common [4] ./pageB.js 1:0-3:2
7777
chunk {1} 1.chunk.js 42 bytes {4} [rendered]
@@ -82,29 +82,29 @@ chunk {1} 1.chunk.js 42 bytes {4} [rendered]
8282
[1] ./b.js 21 bytes {1} {2} [built]
8383
cjs require ./b [4] ./pageB.js 2:8-22
8484
cjs require ./b [5] ./pageC.js 2:17-31
85-
chunk {2} pageB.bundle.js (pageB) 92 bytes [entry] [rendered]
85+
chunk {2} pageB.bundle.js (pageB) 90 bytes [entry] [rendered]
8686
> pageB [4] ./pageB.js
8787
[1] ./b.js 21 bytes {1} {2} [built]
8888
cjs require ./b [4] ./pageB.js 2:8-22
8989
cjs require ./b [5] ./pageC.js 2:17-31
90-
[4] ./pageB.js 71 bytes {2} [built]
91-
chunk {3} pageA.bundle.js (pageA) 92 bytes [entry] [rendered]
90+
[4] ./pageB.js 69 bytes {2} [built]
91+
chunk {3} pageA.bundle.js (pageA) 90 bytes [entry] [rendered]
9292
> pageA [3] ./pageA.js
9393
[0] ./a.js 21 bytes {1} {3} [built]
9494
cjs require ./a [3] ./pageA.js 2:8-22
9595
amd require ./a [5] ./pageC.js 1:0-3:2
96-
[3] ./pageA.js 71 bytes {3} [built]
97-
chunk {4} pageC.bundle.js (pageC) 70 bytes [entry] [rendered]
96+
[3] ./pageA.js 69 bytes {3} [built]
97+
chunk {4} pageC.bundle.js (pageC) 68 bytes [entry] [rendered]
9898
> pageC [5] ./pageC.js
99-
[5] ./pageC.js 70 bytes {4} [built]
99+
[5] ./pageC.js 68 bytes {4} [built]
100100
```
101101

102102
## Minimized (uglify-js, no zip)
103103

104104
```
105-
Hash: 06f18f1663d1b6555aff
106-
Version: webpack 2.1.0-beta.22
107-
Time: 469ms
105+
Hash: 06a73dcf91032a0ba5a5
106+
Version: webpack 2.1.0-beta.25
107+
Time: 417ms
108108
Asset Size Chunks Chunk Names
109109
0.chunk.js 75 bytes 0 [emitted]
110110
1.chunk.js 78 bytes 1 [emitted]
@@ -114,10 +114,10 @@ pageC.bundle.js 1.43 kB 4 [emitted] pageC
114114
Entrypoint pageA = pageA.bundle.js
115115
Entrypoint pageB = pageB.bundle.js
116116
Entrypoint pageC = pageC.bundle.js
117-
chunk {0} 0.chunk.js 5.55 kB {3} {2} [rendered]
117+
chunk {0} 0.chunk.js 5.54 kB {3} {2} [rendered]
118118
> aggressive-merge [3] ./pageA.js 1:0-3:2
119119
> aggressive-merge [4] ./pageB.js 1:0-3:2
120-
[2] ./common.js 5.55 kB {0} [built]
120+
[2] ./common.js 5.54 kB {0} [built]
121121
amd require ./common [3] ./pageA.js 1:0-3:2
122122
amd require ./common [4] ./pageB.js 1:0-3:2
123123
chunk {1} 1.chunk.js 42 bytes {4} [rendered]
@@ -128,19 +128,19 @@ chunk {1} 1.chunk.js 42 bytes {4} [rendered]
128128
[1] ./b.js 21 bytes {1} {2} [built]
129129
cjs require ./b [4] ./pageB.js 2:8-22
130130
cjs require ./b [5] ./pageC.js 2:17-31
131-
chunk {2} pageB.bundle.js (pageB) 92 bytes [entry] [rendered]
131+
chunk {2} pageB.bundle.js (pageB) 90 bytes [entry] [rendered]
132132
> pageB [4] ./pageB.js
133133
[1] ./b.js 21 bytes {1} {2} [built]
134134
cjs require ./b [4] ./pageB.js 2:8-22
135135
cjs require ./b [5] ./pageC.js 2:17-31
136-
[4] ./pageB.js 71 bytes {2} [built]
137-
chunk {3} pageA.bundle.js (pageA) 92 bytes [entry] [rendered]
136+
[4] ./pageB.js 69 bytes {2} [built]
137+
chunk {3} pageA.bundle.js (pageA) 90 bytes [entry] [rendered]
138138
> pageA [3] ./pageA.js
139139
[0] ./a.js 21 bytes {1} {3} [built]
140140
cjs require ./a [3] ./pageA.js 2:8-22
141141
amd require ./a [5] ./pageC.js 1:0-3:2
142-
[3] ./pageA.js 71 bytes {3} [built]
143-
chunk {4} pageC.bundle.js (pageC) 70 bytes [entry] [rendered]
142+
[3] ./pageA.js 69 bytes {3} [built]
143+
chunk {4} pageC.bundle.js (pageC) 68 bytes [entry] [rendered]
144144
> pageC [5] ./pageC.js
145-
[5] ./pageC.js 70 bytes {4} [built]
145+
[5] ./pageC.js 68 bytes {4} [built]
146146
```

‎examples/chunkhash/README.md‎

Lines changed: 34 additions & 32 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,a,c){for(var u,i,f,l=0,s=[];l<t.length;l++)i=t[l],o[i]&&s.push(o[i][0]),o[i]=0;for(u in a)Object.prototype.hasOwnProperty.call(a,u)&&(e[u]=a[u]);for(n&&n(t,a,c);s.length;)s.shift()();if(c)for(l=0;l<c.length;l++)f=r(r.s=c[l]);return f};var t={},o={4:0};r.e=function(e){function n(){a.onerror=a.onload=null,clearTimeout(c);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=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:"d8d9958181fae97ba27d",1:"36e4c03aa77bd58b0abc",2:"1437a149014dcc6cefbb",3:"388c9e54384a6129e3bd"}[e]+".js";var c=setTimeout(n,12e4);a.onerror=a.onload=n,t.appendChild(a);var u=new Promise(function(r,n){o[e]=[r,n]});return o[e][2]=u},r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,r,n){Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},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 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,a,c){for(var u,i,f,l=0,s=[];l<t.length;l++)i=t[l],o[i]&&s.push(o[i][0]),o[i]=0;for(u in a)Object.prototype.hasOwnProperty.call(a,u)&&(e[u]=a[u]);for(n&&n(t,a,c);s.length;)s.shift()();if(c)for(l=0;l<c.length;l++)f=r(r.s=c[l]);return f};var t={},o={4:0};r.e=function(e){function n(){a.onerror=a.onload=null,clearTimeout(c);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=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:"ecd2b16a48d8b92daf31",1:"3ab6307df46b05a2e3c3",2:"af804db11849c698ecbd",3:"9b0423f36b542b42b6a3"}[e]+".js";var c=setTimeout(n,12e4);a.onerror=a.onload=n,t.appendChild(a);var u=new Promise(function(r,n){o[e]=[r,n]});return o[e][2]=u},r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,r,n){Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},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}}([]);
6666
</script>
6767

6868
<!-- optional when using the CommonChunkPlugin for vendor modules -->
@@ -141,67 +141,69 @@ __webpack_require__.e/* System.import */(0).then(__webpack_require__.bind(null,
141141
## Uncompressed
142142

143143
```
144-
Hash: a04360b4818d1203b9bf
145-
Version: webpack 2.1.0-beta.22
146-
Time: 150ms
144+
Hash: 02d122739ca3698772e8
145+
Version: webpack 2.1.0-beta.25
146+
Time: 121ms
147147
Asset Size Chunks Chunk Names
148-
d8d9958181fae97ba27d.js 237 bytes 0, 4 [emitted]
149-
36e4c03aa77bd58b0abc.js 243 bytes 1, 4 [emitted]
150-
common.chunkhash.js 638 bytes 2, 4 [emitted] common
151-
main.chunkhash.js 577 bytes 3, 4 [emitted] main
148+
ecd2b16a48d8b92daf31.js 236 bytes 0, 4 [emitted]
149+
3ab6307df46b05a2e3c3.js 242 bytes 1, 4 [emitted]
150+
common.chunkhash.js 636 bytes 2, 4 [emitted] common
151+
main.chunkhash.js 573 bytes 3, 4 [emitted] main
152152
manifest.chunkhash.js 5.45 kB 4 [emitted] manifest
153-
Entrypoint common = manifest.chunkhash.js common.chunkhash.js
154153
Entrypoint main = manifest.chunkhash.js common.chunkhash.js main.chunkhash.js
155-
chunk {0} d8d9958181fae97ba27d.js 29 bytes {3} [rendered]
154+
Entrypoint common = manifest.chunkhash.js common.chunkhash.js
155+
chunk {0} ecd2b16a48d8b92daf31.js 28 bytes {3} [rendered]
156156
> [3] ./example.js 4:0-25
157-
[2] ./async2.js 29 bytes {0} [built]
157+
[2] ./async2.js 28 bytes {0} [built]
158158
System.import ./async2 [3] ./example.js 4:0-25
159-
chunk {1} 36e4c03aa77bd58b0abc.js 29 bytes {3} [rendered]
159+
chunk {1} 3ab6307df46b05a2e3c3.js 28 bytes {3} [rendered]
160160
> [3] ./example.js 3:0-25
161-
[1] ./async1.js 29 bytes {1} [built]
161+
[1] ./async1.js 28 bytes {1} [built]
162162
System.import ./async1 [3] ./example.js 3:0-25
163-
chunk {2} common.chunkhash.js (common) 97 bytes {4} [initial] [rendered]
163+
chunk {2} common.chunkhash.js (common) 95 bytes {4} [initial] [rendered]
164164
> common [4] multi common
165-
[0] ./vendor.js 69 bytes {2} [built]
165+
[0] ./vendor.js 67 bytes {2} [built]
166+
[exports: default]
166167
harmony import ./vendor [3] ./example.js 1:0-30
167168
single entry ./vendor [4] multi common
168169
[4] multi common 28 bytes {2} [built]
169-
chunk {3} main.chunkhash.js (main) 104 bytes {2} [initial] [rendered]
170+
chunk {3} main.chunkhash.js (main) 100 bytes {2} [initial] [rendered]
170171
> main [3] ./example.js
171-
[3] ./example.js 104 bytes {3} [built]
172+
[3] ./example.js 100 bytes {3} [built]
172173
chunk {4} manifest.chunkhash.js (manifest) 0 bytes [entry] [rendered]
173174
```
174175

175176
## Minimized (uglify-js, no zip)
176177

177178
```
178-
Hash: a04360b4818d1203b9bf
179-
Version: webpack 2.1.0-beta.22
180-
Time: 319ms
179+
Hash: 02d122739ca3698772e8
180+
Version: webpack 2.1.0-beta.25
181+
Time: 278ms
181182
Asset Size Chunks Chunk Names
182-
d8d9958181fae97ba27d.js 40 bytes 0, 4 [emitted]
183-
36e4c03aa77bd58b0abc.js 39 bytes 1, 4 [emitted]
184-
common.chunkhash.js 108 bytes 2, 4 [emitted] common
183+
ecd2b16a48d8b92daf31.js 40 bytes 0, 4 [emitted]
184+
3ab6307df46b05a2e3c3.js 39 bytes 1, 4 [emitted]
185+
common.chunkhash.js 105 bytes 2, 4 [emitted] common
185186
main.chunkhash.js 119 bytes 3, 4 [emitted] main
186187
manifest.chunkhash.js 1.43 kB 4 [emitted] manifest
187-
Entrypoint common = manifest.chunkhash.js common.chunkhash.js
188188
Entrypoint main = manifest.chunkhash.js common.chunkhash.js main.chunkhash.js
189-
chunk {0} d8d9958181fae97ba27d.js 29 bytes {3} [rendered]
189+
Entrypoint common = manifest.chunkhash.js common.chunkhash.js
190+
chunk {0} ecd2b16a48d8b92daf31.js 28 bytes {3} [rendered]
190191
> [3] ./example.js 4:0-25
191-
[2] ./async2.js 29 bytes {0} [built]
192+
[2] ./async2.js 28 bytes {0} [built]
192193
System.import ./async2 [3] ./example.js 4:0-25
193-
chunk {1} 36e4c03aa77bd58b0abc.js 29 bytes {3} [rendered]
194+
chunk {1} 3ab6307df46b05a2e3c3.js 28 bytes {3} [rendered]
194195
> [3] ./example.js 3:0-25
195-
[1] ./async1.js 29 bytes {1} [built]
196+
[1] ./async1.js 28 bytes {1} [built]
196197
System.import ./async1 [3] ./example.js 3:0-25
197-
chunk {2} common.chunkhash.js (common) 97 bytes {4} [initial] [rendered]
198+
chunk {2} common.chunkhash.js (common) 95 bytes {4} [initial] [rendered]
198199
> common [4] multi common
199-
[0] ./vendor.js 69 bytes {2} [built]
200+
[0] ./vendor.js 67 bytes {2} [built]
201+
[exports: default]
200202
harmony import ./vendor [3] ./example.js 1:0-30
201203
single entry ./vendor [4] multi common
202204
[4] multi common 28 bytes {2} [built]
203-
chunk {3} main.chunkhash.js (main) 104 bytes {2} [initial] [rendered]
205+
chunk {3} main.chunkhash.js (main) 100 bytes {2} [initial] [rendered]
204206
> main [3] ./example.js
205-
[3] ./example.js 104 bytes {3} [built]
207+
[3] ./example.js 100 bytes {3} [built]
206208
chunk {4} manifest.chunkhash.js (manifest) 0 bytes [entry] [rendered]
207209
```

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

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

6868
```
69-
Hash: ea390704da12f166e22c
70-
Version: webpack 2.1.0-beta.22
71-
Time: 1209ms
69+
Hash: e81a3bd9b061e4a4628f
70+
Version: webpack 2.1.0-beta.25
71+
Time: 794ms
7272
Asset Size Chunks Chunk Names
7373
ce21cbdd9b894e6af794813eb3fdaf60.png 119 bytes [emitted]
74-
0.js 1.04 kB 0 [emitted]
75-
output.js 7.64 kB 1 [emitted] main
76-
style.css 71 bytes 1 [emitted] main
74+
0.output.js 1.03 kB 0 [emitted]
75+
output.js 7.65 kB 1 [emitted] main
76+
style.css 68 bytes 1 [emitted] main
7777
Entrypoint main = output.js style.css
78-
chunk {0} 0.js 337 bytes {1} [rendered]
78+
chunk {0} 0.output.js 330 bytes {1} [rendered]
7979
> [2] ./example.js 2:0-20
80-
[1] ./chunk.js 26 bytes {0} [built]
80+
[1] ./chunk.js 25 bytes {0} [built]
8181
amd require ./chunk [2] ./example.js 2:0-20
82-
[4] ./style2.css 229 bytes {0} [built]
82+
[4] ./style2.css 223 bytes {0} [built]
8383
cjs require ./style2.css [1] ./chunk.js 1:0-23
8484
[5] ./image2.png 82 bytes {0} [built]
85-
cjs require ./image2.png [4] ./style2.css 6:58-81
85+
cjs require ./image2.png [4] ./style2.css 6:56-79
8686
chunk {1} output.js, style.css (main) 1.59 kB [entry] [rendered]
8787
> main [2] ./example.js
8888
[0] ./style.css 41 bytes {1} [built]
8989
cjs require ./style.css [2] ./example.js 1:0-22
90-
[2] ./example.js 48 bytes {1} [built]
90+
[2] ./example.js 46 bytes {1} [built]
9191
[3] (webpack)/~/css-loader/lib/css-base.js 1.51 kB {1} [built]
9292
cjs require ./../../node_modules/css-loader/lib/css-base.js [4] ./style2.css 1:27-85
9393
Child extract-text-webpack-plugin:
9494
Entrypoint undefined = extract-text-webpack-plugin-output-filename
95-
chunk {0} extract-text-webpack-plugin-output-filename 1.82 kB [entry] [rendered]
95+
chunk {0} extract-text-webpack-plugin-output-filename 1.81 kB [entry] [rendered]
9696
> [2] (webpack)/~/css-loader!./style.css
9797
[0] (webpack)/~/css-loader/lib/css-base.js 1.51 kB {0} [built]
9898
cjs require ./../../node_modules/css-loader/lib/css-base.js [2] (webpack)/~/css-loader!./style.css 1:27-85
9999
[1] ./image.png 82 bytes {0} [built]
100-
cjs require ./image.png [2] (webpack)/~/css-loader!./style.css 6:58-80
101-
[2] (webpack)/~/css-loader!./style.css 228 bytes {0} [built]
100+
cjs require ./image.png [2] (webpack)/~/css-loader!./style.css 6:56-78
101+
[2] (webpack)/~/css-loader!./style.css 222 bytes {0} [built]
102102
```
103103

104104
## Minimized (uglify-js, no zip)
105105

106106
```
107-
Hash: b1ed2cdf881c1aaafd05
108-
Version: webpack 2.1.0-beta.22
109-
Time: 1580ms
107+
Hash: 791614886036b3a69264
108+
Version: webpack 2.1.0-beta.25
109+
Time: 1183ms
110110
Asset Size Chunks Chunk Names
111111
ce21cbdd9b894e6af794813eb3fdaf60.png 119 bytes [emitted]
112-
0.js 201 bytes 0 [emitted]
112+
0.output.js 201 bytes 0 [emitted]
113113
output.js 1.86 kB 1 [emitted] main
114114
style.css 61 bytes 1 [emitted] main
115115
Entrypoint main = output.js style.css
116-
chunk {0} 0.js 320 bytes {1} [rendered]
116+
chunk {0} 0.output.js 319 bytes {1} [rendered]
117117
> [2] ./example.js 2:0-20
118-
[1] ./chunk.js 26 bytes {0} [built]
118+
[1] ./chunk.js 25 bytes {0} [built]
119119
amd require ./chunk [2] ./example.js 2:0-20
120120
[4] ./style2.css 212 bytes {0} [built]
121121
cjs require ./style2.css [1] ./chunk.js 1:0-23
@@ -125,7 +125,7 @@ chunk {1} output.js, style.css (main) 1.59 kB [entry] [rendered]
125125
> main [2] ./example.js
126126
[0] ./style.css 41 bytes {1} [built]
127127
cjs require ./style.css [2] ./example.js 1:0-22
128-
[2] ./example.js 48 bytes {1} [built]
128+
[2] ./example.js 46 bytes {1} [built]
129129
[3] (webpack)/~/css-loader/lib/css-base.js 1.51 kB {1} [built]
130130
cjs require ./../../node_modules/css-loader/lib/css-base.js [4] ./style2.css 1:27-85
131131
Child extract-text-webpack-plugin:

0 commit comments

Comments
 (0)