-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Add BundleMon action to check the build size changes #307
base: development
Are you sure you want to change the base?
Conversation
bundlemon fails when reading large repos, hence we need to limit the amount of files processed.
BundleMonNo change in files bundle size Groups added (1)
Final result: ✅ View report in BundleMon website ➡️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some comments about minor implementation details.
I tested it in skeleton-app (my fork) and it worked nicely, so it also works with vite out of the box: tokland/dhis2-app-skeleton#2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and simple 👍
📌 References
📝 Implementation
GitHub action to monitor the build and/or resulting .zip file size.
General steps:
size_limit="X MB" percent_limit="Y" yarn make-bundlemonrc
or copy the.bundlemonrc_template
and edit manually. This file will define the report.Notes:
yarn build
This PR edits the build action to copy the ZIP file to the build folder. This is needed because BundleMon has trouble processing large repositories (the ZIP is in the root of the repo, this means that baseDir is '.', leading to this error).
If the ZIP file size is not monitored, this change can be discarded.
yarn make-bundlemonrc
This PR also adds a new yarn action yarn make-bundlemonrc that will create a .bundlemonrc file from the .bundlemonrc_template.
This command needs to be provided with vars to convert the template into an usable file:
If the ZIP file size is not monitored, the $build_file_types generation can be removed.
Template and Demo
Originally the template included redundant entries as a demo, an example of how the look like can be seen here.
The template used there looks like this (this one is adapted to UEApp):
BundleMon can be executed locally in the repository via:
yarn bundlemon
If a specific config file needs to be used use the
-c
,--config
option:yarn bundlemon --config conf_file
This is useful to validate the config without waiting for the action to run.
Docs:
https://github.com/LironEr/bundlemon
https://github.com/LironEr/bundlemon-github-actions
https://github.com/LironEr/bundlemon-action