From 06e8ec38880036555cbbc63f975cd370009e6d76 Mon Sep 17 00:00:00 2001 From: Fleny Date: Thu, 18 Apr 2024 11:06:55 +0200 Subject: [PATCH] Add a negative lookahead to prevent .json to be changed (#3536) This was breaking the REST manager as the fetch() Response object uses a .json method to get the JSON body --- scripts/fixCjsExtension.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/fixCjsExtension.js b/scripts/fixCjsExtension.js index fe4ab7050..6fd4c7cb6 100644 --- a/scripts/fixCjsExtension.js +++ b/scripts/fixCjsExtension.js @@ -10,7 +10,7 @@ for await (const dir of dirs) { } const content = await fs.promises.readFile(`dist/cjs${dir}/${file}`, 'utf-8') await fs.promises.rm(`dist/cjs${dir}/${file}`) - fs.promises.writeFile(`dist/cjs${dir}/${file.slice(0, -3)}.cjs`, content.replace(/\.js/g, '.cjs')) + fs.promises.writeFile(`dist/cjs${dir}/${file.slice(0, -3)}.cjs`, content.replace(/\.js(?!on)/g, '.cjs')) }), ) }