File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1- import { terser } from 'rollup-plugin-terser' ;
1+ import { terser } from 'rollup-plugin-terser' ;
22import commonjs from '@rollup/plugin-commonjs' ;
33import nodeResolve from '@rollup/plugin-node-resolve' ;
4+ const pkg = require ( './package.json' ) ;
5+ const name = pkg . name
6+ . split ( '-' )
7+ . map ( ( s ) => s . charAt ( 0 ) . toUpperCase ( ) + s . slice ( 1 ) )
8+ . join ( '' ) ;
49const requirePolyfills = process . env . INCLUDE_POLYFILLS ;
510export default {
611 input : requirePolyfills ? 'lib/esm-including-polyfills/index.js' : 'lib/esm/index.js' ,
@@ -9,15 +14,15 @@ export default {
914 ? 'dist/stringToReactComponent.including-polyfills.umd.min.js'
1015 : 'dist/stringToReactComponent.umd.min.js' ,
1116 format : 'umd' ,
12- name : 'stringToReactComponent' ,
17+ name,
1318 globals : {
1419 'react-dom' : 'ReactDOM' ,
1520 react : 'React' ,
16- '@babel/standalone' : 'Babel'
21+ '@babel/standalone' : 'Babel' ,
1722 } ,
1823 sourcemap : true ,
1924 } ,
20- plugins : [ terser ( ) , commonjs ( ) , nodeResolve ( { preferBuiltins : false } ) ] ,
25+ plugins : [ terser ( ) , commonjs ( ) , nodeResolve ( { preferBuiltins : false } ) ] ,
2126 external : function ( id ) {
2227 return / p r o p - t y p e s $ | r e a c t $ | \@ b a b e l \/ s t a n d a l o n e $ | r e a c t - d o m $ | .t e s t .j s $ | .j s .s n a p $ | .c s s $ / g. test ( id ) ;
2328 } ,
You can’t perform that action at this time.
0 commit comments