From 3a743dd9adb35594e34a30965f82cc488505375f Mon Sep 17 00:00:00 2001 From: merceyz Date: Thu, 14 Jan 2021 22:36:22 +0100 Subject: [PATCH] fix: do dollar replacement correctly --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 83cac61c..ff78bf24 100644 --- a/index.js +++ b/index.js @@ -41,7 +41,9 @@ if (module.hot) { export default $2; `; - return code.replace(/(export default ([^;]*));/, () => replacement); + return code.replace(/(export default ([^;]*));/, (match, $1, $2) => { + return replacement.replace(/\$2/g, () => $2); + }); } function posixify(file) {