Add coverage as a separate babel loader if loaders already exist
With the new E2E test suite, I noticed that coverage is not properly reported when the user provides a custom webpack.config.js. This PR fixes that by detecting if webpack loaders exist and if so, adding a new babel-loader with just the coverage plugin enabled.
Our tests also now enforce that coverage is correctly reported for all tests.
I wonder if we could inject this into any existing babel-loader present in rules. In the current implementation, each babel-loader config item in Webpack triggers its own complete Babel pass over all modules.
Or maybe something like a .babelrc "override" config?
I took a stab at adding to existing loaders in the latest commit. Does that look right? I also updated the webpack-custom test to use a babel.config.js to double check that setting babel-loader options.plugin is merged with the config file.