summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-03-02 16:35:36 -0600
committerMike Greiling <mike@pixelcog.com>2017-03-03 16:47:38 -0600
commitf5f0be534aafd4a2bf1acd9b9154537343fff66e (patch)
treeba2f6014e62328ab70e035e00905245bf39d0a30
parent59f51cbffd61d798179da60d62406a61f8658957 (diff)
downloadgitlab-ce-f5f0be534aafd4a2bf1acd9b9154537343fff66e.tar.gz
remove problematic plugins from karma's webpack config
-rw-r--r--config/karma.config.js13
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';