diff options
author | winniehell <git@winniehell.de> | 2017-02-15 23:39:45 +0100 |
---|---|---|
committer | winniehell <git@winniehell.de> | 2017-02-16 10:12:32 +0100 |
commit | 038ed9ad46ac52a7ab5f2d86f6e48b392f0fb4d9 (patch) | |
tree | edec5ef6c22fc92670d81c8f889b53ce1574aef8 /config | |
parent | 5ad1d40c7f2858a06a7af9ea68a5d9531d936cc9 (diff) | |
download | gitlab-ce-038ed9ad46ac52a7ab5f2d86f6e48b392f0fb4d9.tar.gz |
Move babel config for instanbul to karma config (!9286)
Diffstat (limited to 'config')
-rw-r--r-- | config/karma.config.js | 11 | ||||
-rw-r--r-- | config/webpack.config.js | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/config/karma.config.js b/config/karma.config.js index a1fbeab1f46..a16e2d2077f 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -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({ diff --git a/config/webpack.config.js b/config/webpack.config.js index e63775e43ce..ac117522005 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -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' |