File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
const path = require ( 'path' ) ;
2
2
const pkg = require ( './package.json' ) ;
3
- const libraryName = pkg . name ;
3
+ const library = pkg . name
4
+ . split ( '-' )
5
+ . map ( ( s ) => s . charAt ( 0 ) . toUpperCase ( ) + s . slice ( 1 ) )
6
+ . join ( '' ) ;
4
7
module . exports = ( env ) => {
5
8
const isProduction = env === 'production' ;
6
9
return {
7
10
entry : './src/index.js' ,
8
11
output : {
9
12
filename : isProduction ? 'stringToReactComponent.umd.min.js' : 'stringToReactComponent.umd.js' ,
10
13
path : path . resolve ( __dirname , 'dist' ) ,
11
- library : libraryName ,
14
+ library,
12
15
libraryTarget : 'umd' ,
13
16
publicPath : '/dist/' ,
14
17
umdNamedDefine : true ,
@@ -44,6 +47,7 @@ module.exports = (env) => {
44
47
amd : 'ReactDOM' ,
45
48
root : 'ReactDOM' ,
46
49
} ,
50
+ '@babel/standalone' : 'Babel' ,
47
51
} ,
48
52
} ;
49
53
} ;
You can’t perform that action at this time.
0 commit comments