@@ -15,16 +15,16 @@ module.exports = function makeWebpackConfig(options) {
15
15
* BUILD is for generating minified builds
16
16
* TEST is for generating test builds
17
17
*/
18
- var BUILD = ! ! options . BUILD ;
19
- var TEST = ! ! options . TEST ;
20
- var DEV = ! ! options . DEV ;
18
+ const BUILD = ! ! options . BUILD ;
19
+ const TEST = ! ! options . TEST ;
20
+ const DEV = ! ! options . DEV ;
21
21
22
22
/**
23
23
* Config
24
24
* Reference: http://webpack.github.io/docs/configuration.html
25
25
* This is the object where all configuration gets set
26
26
*/
27
- var config = { } ;
27
+ const config = { } ;
28
28
29
29
config . mode = BUILD
30
30
? 'production'
@@ -330,12 +330,10 @@ module.exports = function makeWebpackConfig(options) {
330
330
babel : {
331
331
< % _ if ( filters . flow ) { - % >
332
332
shouldPrintComment ( commentContents ) {
333
- let regex = DEV
334
- // keep `// @flow` & flow type comments in dev
335
- ? / ( @ f l o w | ^ : ) /
336
- // strip comments
337
- : false ;
338
- return regex . test ( commentContents ) ;
333
+ if ( ! DEV ) return false ;
334
+
335
+ // keep `// @flow` & flow type comments in dev
336
+ return / ( @ f l o w | ^ : ) / . test ( commentContents ) ;
339
337
} , < % } % >
340
338
< % _ if ( ! filters . flow ) { - % >
341
339
comments : false < % } % >
@@ -358,14 +356,13 @@ module.exports = function makeWebpackConfig(options) {
358
356
// Reference: https://github.com/ampedandwired/html-webpack-plugin
359
357
// Render app.html
360
358
if ( ! TEST ) {
361
- let htmlConfig = {
362
- template : 'client / app . template . html ',
363
- filename : '../client/app.html' ,
364
- alwaysWriteToDisk : true
365
- }
366
359
config . plugins . push (
367
- new HtmlWebpackPlugin ( htmlConfig ) ,
368
- new HtmlWebpackHarddiskPlugin ( )
360
+ new HtmlWebpackPlugin ( {
361
+ template : 'client/app.template.html' ,
362
+ filename : '../client/app.html' ,
363
+ alwaysWriteToDisk : true ,
364
+ } ) ,
365
+ new HtmlWebpackHarddiskPlugin ( ) ,
369
366
) ;
370
367
}
371
368
@@ -391,7 +388,7 @@ module.exports = function makeWebpackConfig(options) {
391
388
392
389
if ( DEV ) {
393
390
config . plugins . push (
394
- new webpack . HotModuleReplacementPlugin ( )
391
+ new webpack . HotModuleReplacementPlugin ( ) ,
395
392
) ;
396
393
}
397
394
@@ -466,7 +463,7 @@ module.exports = function makeWebpackConfig(options) {
466
463
process : true ,
467
464
crypto : false ,
468
465
clearImmediate : false ,
469
- setImmediate : false
466
+ setImmediate : false ,
470
467
} ;
471
468
472
469
return config ;
0 commit comments