33 * @Details Webpack config file for adding new vendors, defining entry points and shimming modules.
44 */
55var webpack = require ( 'webpack' ) ;
6- var UglifyJsPlugin = webpack . optimize . UglifyJsPlugin ;
76var path = require ( "path" ) ;
87//var env = require('yargs').argv.mode;
98
@@ -52,11 +51,6 @@ var config = {
5251 'NODE_ENV' : JSON . stringify ( 'development' )
5352 }
5453 } ) ,
55- new webpack . optimize . UglifyJsPlugin ( {
56- minimize : true
57- } ) ,
58- new webpack . optimize . DedupePlugin ( ) ,
59- new webpack . optimize . OccurenceOrderPlugin ( )
6054
6155 ] ,
6256 devtool : 'cheap-module-source-map' ,
@@ -73,26 +67,31 @@ var config = {
7367 output : {
7468 path : path . join ( __dirname , "public" ) ,
7569 filename : "dist/js/[name].bundle.js" ,
76- libraryTarget : "umd " ,
70+ libraryTarget : "commonjs " ,
7771 umdNamedDefine : true ,
7872 } ,
73+
74+ optimization : {
75+ minimize : true
76+ } ,
77+
7978 module : {
8079 noParse : [
8180 //new RegExp(node_dir + '/react'),
8281 new RegExp ( lib_dir + './react-dom.js' )
8382 ] ,
84- loaders : [
85- {
83+ rules : [
84+ {
8685 test : / \. j s x ? $ / ,
87- loaders : [ 'react-hot' ] ,
86+ loader : require . resolve ( 'react-hot' ) ,
8887 include : path . join ( __dirname , 'public' ) ,
8988 exclude : / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) /
90-
9189 } ,
9290 {
93- loader : 'babel' , //'jsx-loader'
94- query : {
95- presets : [ 'react' , 'es2015' ]
91+ loader : require . resolve ( 'babel-loader' ) ,
92+ options : {
93+ presets : [ 'react' , 'es2015' ] ,
94+ compact : true
9695 } ,
9796 include : path . join ( __dirname , 'src' ) ,
9897 exclude : / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) /
0 commit comments