const fs = require('node:fs'); const YandexMetrika = ` `; const html = fs.readFileSync('../build/index.html', 'utf8'); const text = html .replace(/<\/body>/gim, `\n${YandexMetrika}\n`); fs.writeFileSync('../build/index.html', text);