File tree Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Original file line number Diff line number Diff line change 7
7
}
8
8
]
9
9
],
10
+ "plugins" : " transform-runtime" ,
10
11
"env" : {
11
12
"test" : {
12
13
"presets" : [" env" ]
13
- },
14
- "production" : {
15
- "plugins" : [
16
- " transform-runtime"
17
- ]
18
14
}
19
15
}
20
16
}
Original file line number Diff line number Diff line change @@ -3,27 +3,24 @@ import commonjs from 'rollup-plugin-commonjs';
3
3
import nodeResolve from 'rollup-plugin-node-resolve' ;
4
4
import replace from 'rollup-plugin-replace' ;
5
5
import uglify from 'rollup-plugin-uglify' ;
6
+ import { dependencies } from './package.json'
6
7
7
8
const env = process . env . NODE_ENV ;
8
9
const config = {
9
10
entry : 'src/index.js' ,
10
11
plugins : [ ] ,
11
12
} ;
12
13
14
+ const externals = Object . keys ( dependencies ) . join ( '|' ) ;
15
+
13
16
if ( env === 'es' || env === 'cjs' ) {
14
17
config . format = env ;
15
18
config . sourceMap = true ;
16
- config . external = [
17
- 'invariant' ,
18
- 'lodash.curry' ,
19
- 'lodash.isfunction' ,
20
- 'lodash.isobject' ,
21
- 'lodash.isplainobject' ,
22
- 'lodash.map' ,
23
- 'redux' ,
24
- ] ;
19
+ config . external = id => RegExp ( `^(${ externals } )(\/.*)?$` ) . test ( id ) ;
25
20
config . plugins . push (
26
- babel ( )
21
+ babel ( {
22
+ runtimeHelpers : true ,
23
+ } )
27
24
)
28
25
}
29
26
You can’t perform that action at this time.
0 commit comments