From 89c5272504b3b026a27002a62e650ba450f20c23 Mon Sep 17 00:00:00 2001 From: antonio Date: Sun, 2 Jun 2024 16:26:26 +0200 Subject: [PATCH] fix array exception on files broker --- broker/scripts/build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/broker/scripts/build.ts b/broker/scripts/build.ts index 190a2a0..abfb68e 100644 --- a/broker/scripts/build.ts +++ b/broker/scripts/build.ts @@ -8,7 +8,7 @@ const filesList = globSync('dist/**/*.js'); filesList.forEach(file => { let raw = fs.readFileSync(file, 'utf8'); for (const path in paths) { - const deep = (file.match(/\\/g) || []).length; + const deep = (file.match(/\\|\//g) || []).length; const pathText = path.replace('*', ''); const toReplaceText = new RegExp(`"${pathText}(.*?)"`, 'g'); raw = raw.replace(toReplaceText, `"${new Array(deep - 2).fill('../').join('')}${paths[path][0].replace('*', '')}${'$1'}"`);