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 77 }
88 ]
99 ],
10+ "plugins" : " transform-runtime" ,
1011 "env" : {
1112 "test" : {
1213 "presets" : [" env" ]
13- },
14- "production" : {
15- "plugins" : [
16- " transform-runtime"
17- ]
1814 }
1915 }
2016}
Original file line number Diff line number Diff line change @@ -3,27 +3,24 @@ import commonjs from 'rollup-plugin-commonjs';
33import nodeResolve from 'rollup-plugin-node-resolve' ;
44import replace from 'rollup-plugin-replace' ;
55import uglify from 'rollup-plugin-uglify' ;
6+ import { dependencies } from './package.json'
67
78const env = process . env . NODE_ENV ;
89const config = {
910 entry : 'src/index.js' ,
1011 plugins : [ ] ,
1112} ;
1213
14+ const externals = Object . keys ( dependencies ) . join ( '|' ) ;
15+
1316if ( env === 'es' || env === 'cjs' ) {
1417 config . format = env ;
1518 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 ) ;
2520 config . plugins . push (
26- babel ( )
21+ babel ( {
22+ runtimeHelpers : true ,
23+ } )
2724 )
2825}
2926
You can’t perform that action at this time.
0 commit comments