Skip to content

Commit 1727e66

Browse files
authored
loosely convert to camelcase (#298)
1 parent 3f6efda commit 1727e66

File tree

3 files changed

+125
-136
lines changed

3 files changed

+125
-136
lines changed

bin/vue-build

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ var PostCompilePlugin = require('post-compile-webpack-plugin')
1414
var ProgressPlugin = require('webpack/lib/ProgressPlugin')
1515
var ExtractTextPlugin = require('extract-text-webpack-plugin')
1616
var isYarn = require('installed-by-yarn-globally')
17-
var camelcase = require('camelcase')
1817
var tildify = require('tildify')
1918
var loaders = require('../lib/loaders')
2019
var logger = require('../lib/logger')
@@ -211,7 +210,7 @@ if (options.lib) {
211210
webpackConfig.output.filename = replaceExtension(options.entry, '.js')
212211
webpackConfig.output.library = typeof options.lib === 'string'
213212
? options.lib
214-
: camelcase(replaceExtension(options.entry, ''))
213+
: getLibraryName(replaceExtension(options.entry, ''))
215214
webpackConfig.output.libraryTarget = 'umd'
216215
} else {
217216
// only output index.html in non-lib mode
@@ -357,3 +356,7 @@ function merge (obj) {
357356
function replaceExtension (str, ext) {
358357
return str.replace(/\.(vue|js)$/, ext)
359358
}
359+
360+
function getLibraryName (str) {
361+
return str.replace(/[-_.]([\w])/, (_, p1) => p1.toUpperCase())
362+
}

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"babel-core": "^6.21.0",
3838
"babel-loader": "^6.2.10",
3939
"babel-preset-vue-app": "^0.4.0",
40-
"camelcase": "^4.0.0",
4140
"chalk": "^1.1.1",
4241
"commander": "^2.9.0",
4342
"connect-history-api-fallback": "^1.3.0",

0 commit comments

Comments
 (0)