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 6
6
"jsnext:main" : " ./src/index.js" ,
7
7
"scripts" : {
8
8
"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" ,
11
11
"build" : " npm run build:lib && npm run build:umd && npm run build:umd:min" ,
12
12
"clean" : " rimraf lib dist coverage" ,
13
13
"lint" : " eslint src test" ,
51
51
"babel-preset-es2015-loose" : " ^6.1.4" ,
52
52
"babel-preset-react" : " ^6.3.13" ,
53
53
"babel-preset-stage-0" : " ^6.3.13" ,
54
+ "cross-env" : " ^1.0.7" ,
54
55
"eslint" : " ^1.7.1" ,
55
56
"eslint-config-rackt" : " 1.1.0" ,
56
57
"eslint-plugin-react" : " ^3.6.3" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
3
var webpack = require ( 'webpack' )
4
+ var env = process . env . NODE_ENV
4
5
5
6
var reactExternal = {
6
7
root : 'React' ,
@@ -16,7 +17,7 @@ var reduxExternal = {
16
17
amd : 'redux'
17
18
}
18
19
19
- module . exports = {
20
+ var config = {
20
21
externals : {
21
22
'react' : reactExternal ,
22
23
'redux' : reduxExternal
@@ -30,7 +31,26 @@ module.exports = {
30
31
library : 'ReactRedux' ,
31
32
libraryTarget : 'umd'
32
33
} ,
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
+ ]
36
40
}
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