File tree Expand file tree Collapse file tree 4 files changed +27
-40
lines changed Expand file tree Collapse file tree 4 files changed +27
-40
lines changed Original file line number Diff line number Diff line change 66 "jsnext:main" : " ./src/index.js" ,
77 "scripts" : {
88 "build:lib" : " babel src --out-dir lib" ,
9- "build:umd" : " webpack src/index.js dist/react-redux.js --config webpack.config.development .js" ,
10- "build:umd:min" : " webpack src/index.js dist/react-redux.min.js --config webpack.config.production .js" ,
9+ "build:umd" : " cross-env NODE_ENV=development webpack src/index.js dist/react-redux.js" ,
10+ "build:umd:min" : " cross-env NODE_ENV=production webpack src/index.js dist/react-redux.min.js" ,
1111 "build" : " npm run build:lib && npm run build:umd && npm run build:umd:min" ,
1212 "clean" : " rimraf lib dist coverage" ,
1313 "lint" : " eslint src test" ,
5151 "babel-preset-es2015-loose" : " ^6.1.4" ,
5252 "babel-preset-react" : " ^6.3.13" ,
5353 "babel-preset-stage-0" : " ^6.3.13" ,
54+ "cross-env" : " ^1.0.7" ,
5455 "eslint" : " ^1.7.1" ,
5556 "eslint-config-rackt" : " 1.1.0" ,
5657 "eslint-plugin-react" : " ^3.6.3" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11'use strict'
22
33var webpack = require ( 'webpack' )
4+ var env = process . env . NODE_ENV
45
56var reactExternal = {
67 root : 'React' ,
@@ -16,7 +17,7 @@ var reduxExternal = {
1617 amd : 'redux'
1718}
1819
19- module . exports = {
20+ var config = {
2021 externals : {
2122 'react' : reactExternal ,
2223 'redux' : reduxExternal
@@ -30,7 +31,26 @@ module.exports = {
3031 library : 'ReactRedux' ,
3132 libraryTarget : 'umd'
3233 } ,
33- resolve : {
34- extensions : [ '' , '.js' ]
35- }
34+ plugins : [
35+ new webpack . optimize . OccurenceOrderPlugin ( ) ,
36+ new webpack . DefinePlugin ( {
37+ 'process.env.NODE_ENV' : JSON . stringify ( env )
38+ } )
39+ ]
3640}
41+
42+ if ( env === 'production' ) {
43+ config . plugins . push (
44+ new webpack . optimize . UglifyJsPlugin ( {
45+ compressor : {
46+ pure_getters : true ,
47+ unsafe : true ,
48+ unsafe_comps : true ,
49+ screw_ie8 : true ,
50+ warnings : false
51+ }
52+ } )
53+ )
54+ }
55+
56+ module . exports = config
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments