Closed thexodus closed 6 years ago
Actually it was babel-loader
used in webpack. This loader uses options specified in .babelrc
so whenever webpack
is ran, babel-istanbul-plugin
is executed as well which was adding all the test coverage related information into the bundle file.
I have to disable this option while running webpack
. Here's how is configured it.
{
test: /\.jsx?/,
include: APP_DIR,
use: {
loader: 'babel-loader',
options: {
babelrc: false
},
},
}
Expected Behavior
After using
nyc
I should be able to se see code coverage and the webpack working as is.Observed Behavior
But after using
nyc
though I was able to see code coverage, webpack is genrating unnecessary code while bundling. It include every single js/jsx file code coverage content while bundling.Considered guidelines from https://github.com/istanbuljs/nyc https://github.com/istanbuljs/babel-plugin-istanbul
Bonus Points! Code (or Repository) that Reproduces Issue
.babelrc
nyc config
package.json
Forensic Information
Operating System: mac osx high sierra, 10.13.1 Environment Information: information about your project's environment, see instructions below: