Change getModuleName regex to only remove extenion

Given a names like: "some.module.js" and "some.other.module.js" the current regex in DefaultFormatter.prototype.getModuleName will overmatch and only return "some" as the module name in both cases.

Changing the . character class to \w will make sure it does not pick up additional sections and returns "some.module" and "some.other.module" for the names
This commit is contained in:
Jonathan 2015-02-03 01:52:24 -05:00
parent 1801b725bd
commit e92ec6aba7

View File

@ -171,7 +171,7 @@ DefaultFormatter.prototype.getModuleName = function () {
if (!opts.keepModuleIdExtensions) {
// remove extension
filenameRelative = filenameRelative.replace(/\.(.*?)$/, "");
filenameRelative = filenameRelative.replace(/\.(\w*?)$/, "");
}
moduleName += filenameRelative;