Total JavaScript bytes shipped to clients is an important metric to gauge with each patch so that significant changes are known. This will be an especially important metric to track prior to the development of client features. [[ https://github.com/siddharthkp/bundlesize | bundlesize ]] has proven to be an invaluable and well-known tool for these measurements in [[ https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Popups/+/406837/ | Popups ]], [[ https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/MobileFrontend/+/455243/ | MobileFrontend ]] and [[ https://gerrit.wikimedia.org/r/#/c/wikimedia/portals/+/406845/ | Portals ]].
== Acceptance criteria
[] `bundlesize` is added an NPM dependency.
[] A `bundlesize` configuration file specifies the current sizing of each JavaScript ResourceLoader module.
[] `npm test` validates that the JavaScript does not exceed the bundlesize specified in the config.
[] A patch that exceeds the maximum expected bundlesize fails jenkins-bot's tests (votes -1).
= Developer notes
This has been done for Minerva. Learn from it generalising and following conventions where ever possible.