File tree Expand file tree Collapse file tree 3 files changed +37
-2
lines changed Expand file tree Collapse file tree 3 files changed +37
-2
lines changed Original file line number Diff line number Diff line change 11node_modules
22lib /
3+ dist /
Original file line number Diff line number Diff line change 77 "test" : " standard && ava" ,
88 "test:watch" : " npm test -- --watch" ,
99 "clean" : " rimraf lib dist" ,
10- "build" : " babel src --out-dir lib" ,
10+ "build" : " babel src --out-dir lib && webpack && NODE_ENV=production webpack " ,
1111 "build:watch" : " npm run build ./src -- -watch" ,
1212 "prepublish" : " npm run clean && npm run build"
1313 },
3939 "devDependencies" : {
4040 "ava" : " ^0.16.0" ,
4141 "babel-cli" : " ^6.14.0" ,
42+ "babel-core" : " ^6.14.0" ,
4243 "babel-eslint" : " ^6.0.0" ,
44+ "babel-loader" : " ^6.2.5" ,
4345 "babel-preset-es2015" : " ^6.14.0" ,
4446 "babel-preset-stage-2" : " ^6.5.0" ,
4547 "immutable" : " ^3.7.6" ,
4648 "redux" : " ^3.5.2" ,
4749 "rimraf" : " ~2.5.2" ,
48- "standard" : " ^8.0.0"
50+ "standard" : " ^8.0.0" ,
51+ "webpack" : " ^1.13.2"
4952 },
5053 "files" : [
5154 " lib" ,
Original file line number Diff line number Diff line change 1+ const webpack = require ( 'webpack' )
2+ const env = process . env . NODE_ENV
3+ const isProd = env === 'production'
4+
5+ let plugins = [
6+ new webpack . optimize . OccurrenceOrderPlugin ( ) ,
7+ new webpack . DefinePlugin ( {
8+ 'process.env.NODE_ENV' : JSON . stringify ( env )
9+ } )
10+ ]
11+
12+ if ( isProd ) {
13+ plugins . push ( new webpack . optimize . UglifyJsPlugin ( { minimize : true } ) )
14+ }
15+
16+ module . exports = {
17+ entry : './src/index.js' ,
18+ output : {
19+ path : 'dist/' ,
20+ filename : isProd ? 'redux-persist.min.js' : 'redux-persist.js' ,
21+ library : 'redux-persist' ,
22+ libraryTarget : 'umd'
23+ } ,
24+ devtool : 'source-map' ,
25+ plugins,
26+ module : {
27+ loaders : [
28+ { test : / \. j s $ / , loader : 'babel-loader' , exclude : / n o d e _ m o d u l e s / }
29+ ]
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments