Conversation
spajic
approved these changes
Jul 26, 2022
| - name: code checkout | ||
| uses: actions/checkout@v2 | ||
| - name: run sitespeedio test | ||
| run: docker run -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:latest https://f3c5-93-79-0-255.eu.ngrok.io/ --budget.configPath homeBudget.json -n 1 |
Collaborator
There was a problem hiding this comment.
лайк за github-ci, ngrok, fresh sitespeed.io
| module.context.indexOf('node_modules') !== -1 && | ||
| module.context.indexOf('moment') === -1 && | ||
| module.context.indexOf('chart.js') === -1 && | ||
| module.context.indexOf('marked') === -1 |
Collaborator
There was a problem hiding this comment.
в бюджет уложились, но хорошо бы ещё понять, сломается что-то в функциональности сайта если мы выкинем эти библиотеки из vendor.js или нет
(spoiler: насчёт marked не знаю, а в остальном не сломается - но надо понимать почему)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Проблема
На всех страницах
dev.toзагружается файлvendor.js.Анализ показывает, что этот файл содержит библиотеку
moment.js, с большим размером.Подготовка
Дано бюджет:
{ "budget": { "transferSize": { "javascript": 460000 } } }sitespeed.ioпоказал, что бюджет не соблюдается:Оптимизация
webpack-bundle-analyzerдля детализации объемовJavaScriptи выяснил, что больше всего потребляютmoment.jsиChart.js.moment.js, но размер библиотеки продолжил выходить за бюждет.moment.jsиChart.jsиз загрузки вvendor.js. Ситуация заничительно улучшилась, ноvendor.jsпродолжал не входить в бюджет на~6 KB.markedиз загрузки вvendor.js, тест на бюджет прошел успешно:Настройка CI
Для защиты от регрессии я использовал
ngrokи GitHub Actions:ngrok, добавил токен.GitHub Actions