@@ -14,7 +14,6 @@ var PostCompilePlugin = require('post-compile-webpack-plugin')
14
14
var ProgressPlugin = require ( 'webpack/lib/ProgressPlugin' )
15
15
var ExtractTextPlugin = require ( 'extract-text-webpack-plugin' )
16
16
var isYarn = require ( 'installed-by-yarn-globally' )
17
- var camelcase = require ( 'camelcase' )
18
17
var tildify = require ( 'tildify' )
19
18
var loaders = require ( '../lib/loaders' )
20
19
var logger = require ( '../lib/logger' )
@@ -211,7 +210,7 @@ if (options.lib) {
211
210
webpackConfig . output . filename = replaceExtension ( options . entry , '.js' )
212
211
webpackConfig . output . library = typeof options . lib === 'string'
213
212
? options . lib
214
- : camelcase ( replaceExtension ( options . entry , '' ) )
213
+ : getLibraryName ( replaceExtension ( options . entry , '' ) )
215
214
webpackConfig . output . libraryTarget = 'umd'
216
215
} else {
217
216
// only output index.html in non-lib mode
@@ -357,3 +356,7 @@ function merge (obj) {
357
356
function replaceExtension ( str , ext ) {
358
357
return str . replace ( / \. ( v u e | j s ) $ / , ext )
359
358
}
359
+
360
+ function getLibraryName ( str ) {
361
+ return str . replace ( / [ - _ . ] ( [ \w ] ) / , ( _ , p1 ) => p1 . toUpperCase ( ) )
362
+ }
0 commit comments