From d7f78e8339d1665584aa4b1343d40a5f0af08df3 Mon Sep 17 00:00:00 2001 From: Omar Elhawary Date: Thu, 16 May 2024 02:48:00 +0200 Subject: [PATCH] fix: esm build source mapping url replacement (#6368) Co-authored-by: Daniel Lu --- scripts/buildEsm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/buildEsm.js b/scripts/buildEsm.js index 2bca5c924a8..b2b77f902b4 100644 --- a/scripts/buildEsm.js +++ b/scripts/buildEsm.js @@ -2,7 +2,7 @@ const fs = require('fs'); const glob = require('glob'); let pkg = process.argv[process.argv.length - 1]; -let regex = /(.*)\.module\.js/g; +let regex = /(.*)\.module\.js(?!.map)/g; if (fs.existsSync(`${pkg}/dist/module.js`)) { let js = fs.readFileSync(`${pkg}/dist/module.js`, 'utf8'); js = js.replace(regex, '$1.mjs');