diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-03-02 16:35:36 -0600 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-03-03 16:47:38 -0600 |
commit | f5f0be534aafd4a2bf1acd9b9154537343fff66e (patch) | |
tree | ba2f6014e62328ab70e035e00905245bf39d0a30 | |
parent | 59f51cbffd61d798179da60d62406a61f8658957 (diff) | |
download | gitlab-ce-f5f0be534aafd4a2bf1acd9b9154537343fff66e.tar.gz |
remove problematic plugins from karma's webpack config
-rw-r--r-- | config/karma.config.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/config/karma.config.js b/config/karma.config.js index 2f3cc932413..a23e62f5022 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -1,9 +1,10 @@ var path = require('path'); +var webpack = require('webpack'); 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) { +if (webpackConfig.module && webpackConfig.module.rules) { var babelConfig = webpackConfig.module.rules.find(function (rule) { return rule.loader === 'babel-loader'; }); @@ -13,6 +14,16 @@ if (webpackConfig && webpackConfig.module && webpackConfig.module.rules) { babelConfig.options.plugins.push('istanbul'); } +// remove problematic plugins +if (webpackConfig.plugins) { + webpackConfig.plugins = webpackConfig.plugins.filter(function (plugin) { + return !( + plugin instanceof webpack.optimize.CommonsChunkPlugin || + plugin instanceof webpack.DefinePlugin + ); + }); +} + // Karma configuration module.exports = function(config) { var progressReporter = process.env.CI ? 'mocha' : 'progress'; |