Skip to content

Commit 224cd2d

Browse files
author
Josh Stern
authored
Update babelrc to only use istanbul when in test env (#82)
Previously the plugin was being used for all environments which results in code coverage being included in the bundle
1 parent f181511 commit 224cd2d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.babelrc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@
1010
"plugins": [
1111
["babel-plugin-root-import", {
1212
"rootPathSuffix": "src"
13-
}],
14-
"istanbul"
15-
]
13+
}]
14+
],
15+
"env": {
16+
"test": {
17+
"plugins": [
18+
"istanbul"
19+
]
20+
}
21+
}
1622
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"bundle": "webpack --mode=production --progress --colors",
88
"dev": "webpack --mode=development --progress --colors --watch",
9-
"test": "nyc babel-node node_modules/.bin/jasmine && eslint . && npm run report-coverage",
9+
"test": "nyc babel-node --env-name test node_modules/.bin/jasmine && eslint . && npm run report-coverage",
1010
"report-coverage": "nyc report --reporter=lcov > coverage.lcov",
1111
"prepublish": "npm run bundle",
1212
"lint:fix": "eslint . --fix"

0 commit comments

Comments
 (0)