Skip to content

Commit 37aa1ff

Browse files
committed
support parallel build and rebuild
expanded css bundle example
1 parent 543543e commit 37aa1ff

13 files changed

Lines changed: 220 additions & 146 deletions

File tree

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

Lines changed: 37 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@ module.exports = {
3737
loaders: [
3838
{
3939
test: /\.css$/,
40-
loaders: [
41-
ExtractTextPlugin.loader({ remove: true, extract: false }),
42-
"style-loader",
43-
ExtractTextPlugin.loader({ remove: true }),
44-
"css-loader"
45-
]
40+
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
4641
},
4742
{ test: /\.png$/, loader: "file-loader" }
4843
]
@@ -155,7 +150,7 @@ module.exports = {
155150
/***/ function(module, exports, __webpack_require__) {
156151

157152
__webpack_require__(/*! ./style.css */ 1);
158-
__webpack_require__.e/* require */(0, function(__webpack_require__) {[__webpack_require__(/*! ./chunk */ 4)];});
153+
__webpack_require__.e/* require */(0, function(__webpack_require__) {[__webpack_require__(/*! ./chunk */ 3)];});
159154

160155

161156
/***/ },
@@ -186,24 +181,14 @@ webpackJsonp([0],[
186181
// style-loader: Adds some css to the DOM by adding a <style> tag
187182
var dispose = __webpack_require__(/*! (webpack)/~/style-loader/addStyle.js */ 6)
188183
// The css code:
189-
(__webpack_require__(/*! !(webpack)/~/extract-text-webpack-plugin/loader.js?{"remove":true}!(webpack)/~/css-loader!./style2.css */ 3))
184+
(__webpack_require__(/*! !(webpack)/~/css-loader!./style2.css */ 4))
190185
if(false) {
191186
module.hot.accept();
192187
module.hot.dispose(dispose);
193188
}
194189

195190
/***/ },
196191
/* 3 */
197-
/*!**********************************************************************************************************************!*\
198-
!*** (webpack)/~/extract-text-webpack-plugin/loader.js?{"remove":true}!(webpack)/~/css-loader!./style2.css ***!
199-
\**********************************************************************************************************************/
200-
/***/ function(module, exports, __webpack_require__) {
201-
202-
module.exports =
203-
".xyz {\r\n\tbackground: url("+__webpack_require__(/*! ./image2.png */ 5)+");\r\n}\r\n";
204-
205-
/***/ },
206-
/* 4 */
207192
/*!******************!*\
208193
!*** ./chunk.js ***!
209194
\******************/
@@ -212,6 +197,16 @@ webpackJsonp([0],[
212197
__webpack_require__(/*! ./style2.css */ 2);
213198

214199

200+
/***/ },
201+
/* 4 */
202+
/*!*******************************************!*\
203+
!*** (webpack)/~/css-loader!./style2.css ***!
204+
\*******************************************/
205+
/***/ function(module, exports, __webpack_require__) {
206+
207+
module.exports =
208+
".xyz {\r\n\tbackground: url("+__webpack_require__(/*! ./image2.png */ 5)+");\r\n}\r\n";
209+
215210
/***/ },
216211
/* 5 */
217212
/*!********************!*\
@@ -238,32 +233,30 @@ body {
238233
## Uncompressed
239234

240235
```
241-
Hash: da8cc6c9a52fa919b115
242-
Version: webpack 1.3.2-beta2
243-
Time: 126ms
236+
Hash: 16bad7466ac50f139f21
237+
Version: webpack 1.3.2-beta8
238+
Time: 128ms
244239
Asset Size Chunks Chunk Names
245240
ce21cbdd9b894e6af794813eb3fdaf60.png 119 [emitted]
246241
style.css 71 [emitted]
247-
0.output.js 1552 0 [emitted]
242+
0.output.js 1252 0 [emitted]
248243
output.js 4080 1 [emitted] main
249-
chunk {0} 0.output.js 744 {1} [rendered]
244+
chunk {0} 0.output.js 650 {1} [rendered]
250245
> [0] ./example.js 2:0-20
251-
[2] ./style2.css 550 {0} [built]
252-
cjs require ./style2.css [4] ./chunk.js 1:0-23
253-
[3] (webpack)/~/extract-text-webpack-plugin/loader.js?{"remove":true}!(webpack)/~/css-loader!./style2.css 87 {0} [built]
254-
cjs require !!(webpack)/~\extract-text-webpack-plugin\loader.js?{"remove":true}!(webpack)\node_modules\css-loader\index.js!.\style2.css [2] ./style2.css 4:2-282
255-
[4] ./chunk.js 26 {0} [built]
246+
[2] ./style2.css 456 {0} [built]
247+
cjs require ./style2.css [3] ./chunk.js 1:0-23
248+
[3] ./chunk.js 26 {0} [built]
256249
amd require ./chunk [0] ./example.js 2:0-20
250+
[4] (webpack)/~/css-loader!./style2.css 87 {0} [built]
251+
cjs require !!(webpack)\node_modules\css-loader\index.js!.\style2.css [2] ./style2.css 4:2-188
257252
[5] ./image2.png 81 {0} [built]
258-
cjs require ./image2.png [3] (webpack)/~/extract-text-webpack-plugin/loader.js?{"remove":true}!(webpack)/~/css-loader!./style2.css 2:32-55
253+
cjs require ./image2.png [4] (webpack)/~/css-loader!./style2.css 2:32-55
259254
chunk {1} output.js (main) 89 [rendered]
260255
> main [0] ./example.js
261256
[0] ./example.js 48 {1} [built]
262257
[1] ./style.css 41 {1} [built]
263258
cjs require ./style.css [0] ./example.js 1:0-22
264259
Child extract-text-webpack-plugin:
265-
Hash: d700e4ce4d0a140c5961
266-
Version: webpack 1.3.2-beta2
267260
Asset Size Chunks Chunk Names
268261
ce21cbdd9b894e6af794813eb3fdaf60.png 119
269262
chunk {0} (webpack)/~\extract-text-webpack-plugin (webpack)\node_modules\css-loader\index.js!.\style.css 167 [rendered]
@@ -276,37 +269,35 @@ Child extract-text-webpack-plugin:
276269
## Minimized (uglify-js, no zip)
277270

278271
```
279-
Hash: 5aa472e382f388bfdcb6
280-
Version: webpack 1.3.2-beta2
281-
Time: 202ms
272+
Hash: a1cb30e2febe8a9ad8eb
273+
Version: webpack 1.3.2-beta8
274+
Time: 209ms
282275
Asset Size Chunks Chunk Names
283276
ce21cbdd9b894e6af794813eb3fdaf60.png 119 [emitted]
284277
style.css 61 [emitted]
285278
0.output.js 202 0 [emitted]
286279
output.js 749 1 [emitted] main
287-
chunk {0} 0.output.js 727 {1} [rendered]
280+
chunk {0} 0.output.js 633 {1} [rendered]
288281
> [0] ./example.js 2:0-20
289-
[2] ./style2.css 550 {0} [built]
290-
cjs require ./style2.css [4] ./chunk.js 1:0-23
291-
[3] (webpack)/~/extract-text-webpack-plugin/loader.js?{"remove":true}!(webpack)/~/css-loader!./style2.css 70 {0} [built]
292-
cjs require !!(webpack)/~\extract-text-webpack-plugin\loader.js?{"remove":true}!(webpack)\node_modules\css-loader\index.js!.\style2.css [2] ./style2.css 4:2-282
293-
[4] ./chunk.js 26 {0} [built]
282+
[2] ./style2.css 456 {0} [built]
283+
cjs require ./style2.css [3] ./chunk.js 1:0-23
284+
[3] ./chunk.js 26 {0} [built]
294285
amd require ./chunk [0] ./example.js 2:0-20
286+
[4] (webpack)/~/css-loader!./style2.css 70 {0} [built]
287+
cjs require !!(webpack)\node_modules\css-loader\index.js!.\style2.css [2] ./style2.css 4:2-188
295288
[5] ./image2.png 81 {0} [built]
296-
cjs require ./image2.png [3] (webpack)/~/extract-text-webpack-plugin/loader.js?{"remove":true}!(webpack)/~/css-loader!./style2.css 2:24-47
289+
cjs require ./image2.png [4] (webpack)/~/css-loader!./style2.css 2:24-47
297290
chunk {1} output.js (main) 89 [rendered]
298291
> main [0] ./example.js
299292
[0] ./example.js 48 {1} [built]
300293
[1] ./style.css 41 {1} [built]
301294
cjs require ./style.css [0] ./example.js 1:0-22
302295
303296
WARNING in 0.output.js from UglifyJs
304-
Condition always false [(webpack)/~/extract-text-webpack-plugin/loader.js?{"remove":true,"extract":false}!(webpack)/~/style-loader!(webpack)/~/extract-text-webpack-plugin/loader.js?{"remove":true}!(webpack)/~/css-loader!./style2.css:5,0]
305-
Dropping unreachable code [(webpack)/~/extract-text-webpack-plugin/loader.js?{"remove":true,"extract":false}!(webpack)/~/style-loader!(webpack)/~/extract-text-webpack-plugin/loader.js?{"remove":true}!(webpack)/~/css-loader!./style2.css:6,0]
306-
Side effects in initialization of unused variable dispose [(webpack)/~/extract-text-webpack-plugin/loader.js?{"remove":true,"extract":false}!(webpack)/~/style-loader!(webpack)/~/extract-text-webpack-plugin/loader.js?{"remove":true}!(webpack)/~/css-loader!./style2.css:2,0]
297+
Condition always false [(webpack)/~/extract-text-webpack-plugin/loader.js?{"omit":1,"extract":true,"remove":true}!(webpack)/~/style-loader!(webpack)/~/css-loader!./style2.css:5,0]
298+
Dropping unreachable code [(webpack)/~/extract-text-webpack-plugin/loader.js?{"omit":1,"extract":true,"remove":true}!(webpack)/~/style-loader!(webpack)/~/css-loader!./style2.css:6,0]
299+
Side effects in initialization of unused variable dispose [(webpack)/~/extract-text-webpack-plugin/loader.js?{"omit":1,"extract":true,"remove":true}!(webpack)/~/style-loader!(webpack)/~/css-loader!./style2.css:2,0]
307300
Child extract-text-webpack-plugin:
308-
Hash: d25490764bf82b317fae
309-
Version: webpack 1.3.2-beta2
310301
Asset Size Chunks Chunk Names
311302
ce21cbdd9b894e6af794813eb3fdaf60.png 119
312303
chunk {0} (webpack)/~\extract-text-webpack-plugin (webpack)\node_modules\css-loader\index.js!.\style.css 150 [rendered]

examples/code-splitted-css-bundle/webpack.config.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@ module.exports = {
44
loaders: [
55
{
66
test: /\.css$/,
7-
loaders: [
8-
ExtractTextPlugin.loader({ remove: true, extract: false }),
9-
"style-loader",
10-
ExtractTextPlugin.loader({ remove: true }),
11-
"css-loader"
12-
]
7+
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
138
},
149
{ test: /\.png$/, loader: "file-loader" }
1510
]

examples/css-bundle/README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ module.exports = {
2222
loaders: [
2323
{
2424
test: /\.css$/,
25-
loaders: [
26-
ExtractTextPlugin.loader({ remove: true }),
27-
"css-loader"
28-
]
25+
loader: ExtractTextPlugin.extract("css-loader")
2926
},
3027
{ test: /\.png$/, loader: "file-loader" }
3128
]
@@ -117,8 +114,8 @@ body {
117114

118115
```
119116
Hash: 954e72d5ec1de4b4dc80
120-
Version: webpack 1.3.2-beta2
121-
Time: 95ms
117+
Version: webpack 1.3.2-beta8
118+
Time: 96ms
122119
Asset Size Chunks Chunk Names
123120
ce21cbdd9b894e6af794813eb3fdaf60.png 119 [emitted]
124121
style.css 69 [emitted]
@@ -129,8 +126,6 @@ chunk {0} output.js (main) 64 [rendered]
129126
[1] ./style.css 41 {0} [built]
130127
cjs require ./style.css [0] ./example.js 1:0-22
131128
Child extract-text-webpack-plugin:
132-
Hash: ac8625c3bf3709b4c609
133-
Version: webpack 1.3.2-beta2
134129
Asset Size Chunks Chunk Names
135130
ce21cbdd9b894e6af794813eb3fdaf60.png 119 [emitted]
136131
chunk {0} (webpack)/~\extract-text-webpack-plugin (webpack)\node_modules\css-loader\index.js!.\style.css 163 [rendered]
@@ -144,7 +139,7 @@ Child extract-text-webpack-plugin:
144139

145140
```
146141
Hash: 3abfd6ec08d4cc31f089
147-
Version: webpack 1.3.2-beta2
142+
Version: webpack 1.3.2-beta8
148143
Time: 136ms
149144
Asset Size Chunks Chunk Names
150145
ce21cbdd9b894e6af794813eb3fdaf60.png 119 [emitted]
@@ -156,8 +151,6 @@ chunk {0} output.js (main) 64 [rendered]
156151
[1] ./style.css 41 {0} [built]
157152
cjs require ./style.css [0] ./example.js 1:0-22
158153
Child extract-text-webpack-plugin:
159-
Hash: efab1621ec9e016b9f16
160-
Version: webpack 1.3.2-beta2
161154
Asset Size Chunks Chunk Names
162155
ce21cbdd9b894e6af794813eb3fdaf60.png 119 [emitted]
163156
chunk {0} (webpack)/~\extract-text-webpack-plugin (webpack)\node_modules\css-loader\index.js!.\style.css 150 [rendered]

examples/css-bundle/webpack.config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ module.exports = {
44
loaders: [
55
{
66
test: /\.css$/,
7-
loaders: [
8-
ExtractTextPlugin.loader({ remove: true }),
9-
"css-loader"
10-
]
7+
loader: ExtractTextPlugin.extract("css-loader")
118
},
129
{ test: /\.png$/, loader: "file-loader" }
1310
]

0 commit comments

Comments
 (0)