Skip to content

Commit 5ffe30a

Browse files
update webpack config : change lib name and
set @babel/standalone as an external module
1 parent d89aa89 commit 5ffe30a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

webpack.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
const path = require('path');
22
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('');
47
module.exports = (env) => {
58
const isProduction = env === 'production';
69
return {
710
entry: './src/index.js',
811
output: {
912
filename: isProduction ? 'stringToReactComponent.umd.min.js' : 'stringToReactComponent.umd.js',
1013
path: path.resolve(__dirname, 'dist'),
11-
library: libraryName,
14+
library,
1215
libraryTarget: 'umd',
1316
publicPath: '/dist/',
1417
umdNamedDefine: true,
@@ -44,6 +47,7 @@ module.exports = (env) => {
4447
amd: 'ReactDOM',
4548
root: 'ReactDOM',
4649
},
50+
'@babel/standalone': 'Babel',
4751
},
4852
};
4953
};

0 commit comments

Comments
 (0)