Skip to content

Conversation

@andrewiggins
Copy link
Collaborator

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.

// devtool: 'module-source-map',
mode: webpackConfig.mode || 'development',
module: {
// @TODO check webpack version and use loaders VS rules as the key here appropriately:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this TODO is handled by line 180 below so I removed it

@developit
Copy link
Owner

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?

@andrewiggins
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants