Test compiling frontend assets for production in CI
Currently we do not test our CI production build process in CI. If we break anything like:
- Including an invalid production-specific plugin or config option in
webpack.config.js
- Accidentally placing a module needed to compile our assets within
devDependencies
inpackage.json
We won't find out about these issues until an omnibus-gitlab
build fails or somebody attempting to install from source complains.
We ought to have an extra build step in CI which does the following:
- run
yarn install --production
to grab just our production-only node modules - compile our assets with
NODE_ENV=production rake gitlab:assets:compile
- ensure that the build succeeds with no warnings or errors
We can also use this as an opportunity to generate a bundle analyzer which we can output along with our coverage artifacts to analyze the production size of our bundles as well as their composition.