Last active
August 5, 2019 11:11
-
-
Save srsad/ace90c282fb3dbea3e79c28cd966e29a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// заказчик начал просто закидывать скриптами от разных сервисов, | |
// писать для каждого отельный модуль, слишком затратно по времени, по этому вот такой костыль | |
// в итоге подключаем все скрипты после </body> и отдаем нормальный html | |
hooks: { | |
generate: { | |
page(page) { | |
let jsFiles = [ | |
`jivosite script`, | |
`aloka`, | |
`calltraking`, | |
`Yandex.Metrika counter`, | |
// ... | |
]; | |
for (const item of jsFiles) { | |
page.html = page.html.replace('</body>', `${item}</body>`) | |
} | |
return page | |
}, | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment