Reduce BookBrainz JavaScript bundle sizes
The goal of this task is to reduce the size of JavaScript bundles being served to users of the BookBrainz website. At the moment, the site's JavaScript code isn't mangled or minified. The only build-time JavaScript optimization being run (asides from code transpilation) is the "factor-bundle" browserify transform which extracts common dependencies of modules into a separate JS bundle.
UglifyJS is a widely-used compressor and code-mangler. For this task, your job is to pipe the output of the existing browserify build to the UglifyJS command-line interface with appropriate options to get compressed JavaScript bundles. The scripts responsible for building the JS bundles are named build-client-js.sh
and watch-client-js.sh
and can be found in the /scripts folder of the BookBrainz site repository. For an example of piping browserify output to UglifyJS, refer to the factor-bundle documentation.
If you wish to add any extra transforms to the bundling and minifying process, feel free to do so, but be sure to give reasons for your additions.
To submit your work, clone your fork of the bookbrainz-site repository and create a new branch named "browserify-optimizations-YOUR_GCI_USERNAME". Commit your changes, using small commits which make clear, self-contained changes, and using the conventions here. Finally, push your work to GitHub and create a new Pull Request.