提交 038ed9ad 编写于 作者: W winniehell

Move babel config for instanbul to karma config (!9286)

上级 5ad1d40c
---
title: Move babel config for instanbul to karma config
merge_request: 9286
author: winniehell
......@@ -2,6 +2,17 @@ var path = require('path');
var webpackConfig = require('./webpack.config.js');
var ROOT_PATH = path.resolve(__dirname, '..');
// add coverage instrumentation to babel config
if (webpackConfig && webpackConfig.module && webpackConfig.module.rules) {
var babelConfig = webpackConfig.module.rules.find(function (rule) {
return rule.loader === 'babel-loader';
});
babelConfig.options = babelConfig.options || {};
babelConfig.options.plugins = babelConfig.options.plugins || [];
babelConfig.options.plugins.push('istanbul');
}
// Karma configuration
module.exports = function(config) {
config.set({
......
......@@ -54,7 +54,6 @@ var config = {
exclude: /(node_modules|vendor\/assets)/,
loader: 'babel-loader',
options: {
plugins: IS_PRODUCTION ? [] : ['istanbul'],
presets: [
["es2015", {"modules": false}],
'stage-2'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册