diff --git a/tslib.js b/tslib.js index 53455fd..95beb91 100644 --- a/tslib.js +++ b/tslib.js @@ -398,8 +398,8 @@ var __rewriteRelativeImportExtension; __rewriteRelativeImportExtension = function (path, preserveJsx) { if (typeof path === "string" && /^\.\.?\//.test(path)) { - return path.replace(/\.(tsx)$|(\.d)?(\.[^./]+?)?\.([cm])?ts$/i, function (m, tsx, d, ext, cm) { - return tsx ? preserveJsx ? ".jsx" : ".js" : d && (ext && !cm || !ext) ? m : ((d || "") + (ext || "") + "." + (cm || "").toLowerCase() + "js"); + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); }); } return path;