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' ;
2
2
import commonjs from '@rollup/plugin-commonjs' ;
3
3
import 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 ( '' ) ;
4
9
const requirePolyfills = process . env . INCLUDE_POLYFILLS ;
5
10
export default {
6
11
input : requirePolyfills ? 'lib/esm-including-polyfills/index.js' : 'lib/esm/index.js' ,
@@ -9,15 +14,15 @@ export default {
9
14
? 'dist/stringToReactComponent.including-polyfills.umd.min.js'
10
15
: 'dist/stringToReactComponent.umd.min.js' ,
11
16
format : 'umd' ,
12
- name : 'stringToReactComponent' ,
17
+ name,
13
18
globals : {
14
19
'react-dom' : 'ReactDOM' ,
15
20
react : 'React' ,
16
- '@babel/standalone' : 'Babel'
21
+ '@babel/standalone' : 'Babel' ,
17
22
} ,
18
23
sourcemap : true ,
19
24
} ,
20
- plugins : [ terser ( ) , commonjs ( ) , nodeResolve ( { preferBuiltins : false } ) ] ,
25
+ plugins : [ terser ( ) , commonjs ( ) , nodeResolve ( { preferBuiltins : false } ) ] ,
21
26
external : function ( id ) {
22
27
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 ) ;
23
28
} ,
You can’t perform that action at this time.
0 commit comments