From e92ec6aba791e2c841b7eaf12c1d11895e23a507 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 3 Feb 2015 01:52:24 -0500 Subject: [PATCH] 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 --- lib/6to5/transformation/modules/_default.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/6to5/transformation/modules/_default.js b/lib/6to5/transformation/modules/_default.js index 300c12ab18..1bc78c15ab 100644 --- a/lib/6to5/transformation/modules/_default.js +++ b/lib/6to5/transformation/modules/_default.js @@ -171,7 +171,7 @@ DefaultFormatter.prototype.getModuleName = function () { if (!opts.keepModuleIdExtensions) { // remove extension - filenameRelative = filenameRelative.replace(/\.(.*?)$/, ""); + filenameRelative = filenameRelative.replace(/\.(\w*?)$/, ""); } moduleName += filenameRelative;