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'}"`);