From ce3014c7113f6a417367cc7861f3d1eb56be9642 Mon Sep 17 00:00:00 2001 From: Vyacheslav Orlovsky Date: Wed, 3 Aug 2022 11:01:40 +0300 Subject: [PATCH] Update index.js Handling the case of presence of some additional matching group in the alias string --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index a9bcdb1..294d6cd 100644 --- a/index.js +++ b/index.js @@ -58,7 +58,7 @@ exports.resolve = (modulePath, sourceFile, config) => { const re = new RegExp(`^${map[i][0]}($|/)`); const match = modulePath.match(re); if (match) { - resolvePath = modulePath.replace(match[0], `${map[i][1]}${match[1]}`); + resolvePath = modulePath.replace(match[0], `${map[i][1]}${match.slice(1).join('')}`); break; } }