@@ -13,59 +13,59 @@ module.exports = function (env) {
13
13
const plugins = [
14
14
new webpack . optimize . CommonsChunkPlugin ( {
15
15
names : [ 'inferno.vendor' ] ,
16
- chunks : [ " inferno" ] ,
17
- minChunks : function ( module ) {
16
+ chunks : [ ' inferno' ] ,
17
+ minChunks : function ( module ) {
18
18
return isExternal ( module )
19
- } ,
19
+ }
20
20
} ) ,
21
21
new webpack . optimize . CommonsChunkPlugin ( {
22
- name : " purecss.vendor" ,
23
- chunks : [ " purecss" ] ,
24
- minChunks : function ( module , count ) {
22
+ name : ' purecss.vendor' ,
23
+ chunks : [ ' purecss' ] ,
24
+ minChunks : function ( module ) {
25
25
return isExternal ( module )
26
- } ,
26
+ }
27
27
} ) ,
28
28
new webpack . optimize . CommonsChunkPlugin ( {
29
- name : " mincss.vendor" ,
30
- chunks : [ " mincss" ] ,
31
- minChunks : function ( module , count ) {
29
+ name : ' mincss.vendor' ,
30
+ chunks : [ ' mincss' ] ,
31
+ minChunks : function ( module ) {
32
32
return isExternal ( module )
33
- } ,
33
+ }
34
34
} ) ,
35
35
new webpack . optimize . CommonsChunkPlugin ( {
36
- name : " photo.vendor" ,
37
- chunks : [ " photo" ] ,
38
- minChunks : function ( module , count ) {
36
+ name : ' photo.vendor' ,
37
+ chunks : [ ' photo' ] ,
38
+ minChunks : function ( module ) {
39
39
return isExternal ( module )
40
- } ,
40
+ }
41
41
} ) ,
42
42
new webpack . DefinePlugin ( {
43
- 'process.env' : { NODE_ENV : JSON . stringify ( nodeEnv ) }
43
+ 'process.env' : { NODE_ENV : JSON . stringify ( nodeEnv ) }
44
44
} ) ,
45
45
new webpack . NamedModulesPlugin ( ) ,
46
46
new HtmlWebpackPlugin ( {
47
47
filename : 'inferno.html' ,
48
- title : 'Inferno' ,
49
- template : 'inferno/index-template.html' ,
50
- chunks : [ 'inferno.vendor' , 'inferno' ] ,
48
+ title : 'Inferno' ,
49
+ template : 'inferno/index-template.html' ,
50
+ chunks : [ 'inferno.vendor' , 'inferno' ]
51
51
} ) ,
52
52
new HtmlWebpackPlugin ( {
53
53
filename : 'purecss.html' ,
54
54
title : 'PureCSS' ,
55
55
template : 'purecss/index-template.html' ,
56
- chunks : [ 'purecss.vendor' , 'purecss' ] ,
57
- } ) ,
56
+ chunks : [ 'purecss.vendor' , 'purecss' ]
57
+ } ) ,
58
58
new HtmlWebpackPlugin ( {
59
59
filename : 'mincss.html' ,
60
60
title : 'MINCSS' ,
61
61
template : 'mincss/index-template.html' ,
62
- chunks : [ 'mincss.vendor' , 'mincss' ] ,
62
+ chunks : [ 'mincss.vendor' , 'mincss' ]
63
63
} ) ,
64
64
new HtmlWebpackPlugin ( {
65
65
filename : 'photo.html' ,
66
66
title : 'Photo' ,
67
67
template : 'photo/index-template.html' ,
68
- chunks : [ 'photo.vendor' , 'photo' ] ,
68
+ chunks : [ 'photo.vendor' , 'photo' ]
69
69
} )
70
70
]
71
71
@@ -85,13 +85,14 @@ module.exports = function (env) {
85
85
sourceMap : true
86
86
} ) ,
87
87
new CompressionPlugin ( {
88
- asset : "[path].gz[query]" ,
89
- algorithm : "gzip" ,
90
- test : / \. j s $ | \. c s s $ | \. h t m l $ | \. e o t $ | \. s v g $ | \. t t f $ | \. w o f f $ / ,
91
- threshold : 1024 ,
92
- minRatio : 0.8
93
- } ) ,
94
- new ExtractTextPlugin ( "[name].css" )
88
+ asset : '[path].gz[query]' ,
89
+ algorithm : 'gzip' ,
90
+ test : / \. j s $ | \. c s s $ | \. h t m l $ | \. e o t $ | \. s v g $ | \. t t f $ | \. w o f f $ / ,
91
+ threshold : 1024 ,
92
+ minRatio : 0.8
93
+ } ) ,
94
+ new ExtractTextPlugin ( '[name].css' ) ,
95
+ new webpack . optimize . ModuleConcatenationPlugin ( )
95
96
)
96
97
} else {
97
98
plugins . push (
@@ -110,7 +111,7 @@ module.exports = function (env) {
110
111
} ,
111
112
output : {
112
113
path : __dirname + '/static' ,
113
- filename : '[name].js' ,
114
+ filename : '[name].js'
114
115
} ,
115
116
module : {
116
117
rules : [
@@ -120,8 +121,8 @@ module.exports = function (env) {
120
121
loader : 'html-loader' ,
121
122
query : {
122
123
name : '[name].[ext]'
123
- } ,
124
- } ,
124
+ }
125
+ }
125
126
} ,
126
127
{
127
128
test : / \. l e s s $ / ,
@@ -133,23 +134,23 @@ module.exports = function (env) {
133
134
} ,
134
135
{
135
136
test : / \. w o f f ( 2 ) ? ( \? v = [ 0 - 9 ] \. [ 0 - 9 ] \. [ 0 - 9 ] ) ? $ / ,
136
- loader : isProd ? " file-loader?limit=10000&mimetype=application/font-woff" : " url-loader?limit=10000&mimetype=application/font-woff"
137
+ loader : isProd ? ' file-loader?limit=10000&mimetype=application/font-woff' : ' url-loader?limit=10000&mimetype=application/font-woff'
137
138
} ,
138
139
{
139
140
test : / \. ( t t f | e o t | s v g ) ( \? v = [ 0 - 9 ] \. [ 0 - 9 ] \. [ 0 - 9 ] ) ? $ / ,
140
- loader : isProd ? " file-loader" : " url-loader"
141
+ loader : isProd ? ' file-loader' : ' url-loader'
141
142
} ,
142
143
{
143
144
test : / \. ( j p g | j p e g | p n g ) $ / ,
144
- loader : isProd ? " file-loader" : " url-loader"
145
+ loader : isProd ? ' file-loader' : ' url-loader'
145
146
} ,
146
147
{
147
148
test : / \. ( j s | j s x ) $ / ,
148
149
use : [
149
150
'babel-loader'
150
- ] ,
151
- } ,
152
- ] ,
151
+ ]
152
+ }
153
+ ]
153
154
} ,
154
155
resolve : {
155
156
extensions : [ '.webpack-loader.js' , '.web-loader.js' , '.loader.js' , '.js' , '.jsx' ] ,
@@ -164,12 +165,12 @@ module.exports = function (env) {
164
165
performance : isProd && {
165
166
maxAssetSize : 100000 ,
166
167
maxEntrypointSize : 100000 ,
167
- hints : 'warning' ,
168
+ hints : 'warning'
168
169
} ,
169
170
170
171
stats : {
171
172
colors : {
172
- green : '\u001b[32m' ,
173
+ green : '\u001b[32m'
173
174
}
174
175
} ,
175
176
@@ -191,15 +192,15 @@ module.exports = function (env) {
191
192
version : false ,
192
193
warnings : true ,
193
194
colors : {
194
- green : '\u001b[32m' ,
195
+ green : '\u001b[32m'
195
196
}
196
- } ,
197
+ }
197
198
}
198
199
}
199
200
}
200
201
201
202
function isExternal ( module ) {
202
- var userRequest = module . userRequest
203
+ const userRequest = module . userRequest
203
204
204
205
if ( typeof userRequest !== 'string' ) {
205
206
return false
@@ -227,12 +228,12 @@ function lessNonExtractTextLoader() {
227
228
228
229
function extractTextLoader ( ) {
229
230
return ExtractTextPlugin . extract ( {
230
- fallback : 'style-loader' , use : 'css-loader'
231
- } )
231
+ fallback : 'style-loader' , use : 'css-loader'
232
+ } )
232
233
}
233
234
234
235
function lessExtractTextLoader ( ) {
235
236
return ExtractTextPlugin . extract ( {
236
- fallback : 'style-loader' , use : 'css-loader!less-loader'
237
- } )
237
+ fallback : 'style-loader' , use : 'css-loader!less-loader'
238
+ } )
238
239
}
0 commit comments