@@ -13,10 +13,16 @@ const globals = {
1313 react : 'React' ,
1414} ;
1515const external = Object . keys ( globals ) ;
16- const babelOptions = {
17- babelrc : false ,
18- presets : [ [ 'es2015' , { modules : false } ] , 'stage-0' , 'react' ] ,
19- plugins : [ 'external-helpers' ] ,
16+ const babelOptions = ( production ) => {
17+ let result = {
18+ babelrc : false ,
19+ presets : [ [ 'es2015' , { modules : false } ] , 'stage-0' , 'react' ] ,
20+ plugins : [ 'external-helpers' ] ,
21+ } ;
22+ if ( production ) {
23+ result . plugins . push ( 'transform-react-remove-prop-types' ) ;
24+ } ;
25+ return result ;
2026} ;
2127
2228export default [
@@ -27,7 +33,7 @@ export default [
2733 format : 'es' ,
2834 } ,
2935 external : external ,
30- plugins : [ babel ( babelOptions ) ] ,
36+ plugins : [ babel ( babelOptions ( false ) ) ] ,
3137 } ,
3238 {
3339 input : 'src/index.umd.js' ,
@@ -38,7 +44,7 @@ export default [
3844 } ,
3945 globals : globals ,
4046 external : external ,
41- plugins : [ babel ( babelOptions ) , resolve ( ) ] ,
47+ plugins : [ babel ( babelOptions ( false ) ) , resolve ( ) ] ,
4248 } ,
4349 {
4450 input : 'src/index.umd.js' ,
@@ -49,6 +55,6 @@ export default [
4955 } ,
5056 globals : globals ,
5157 external : external ,
52- plugins : [ babel ( babelOptions ) , resolve ( ) , uglify ( { } , minify ) ] ,
58+ plugins : [ babel ( babelOptions ( true ) ) , resolve ( ) , uglify ( { } , minify ) ] ,
5359 } ,
5460] ;
0 commit comments