Skip to content

Commit

Permalink
Chore: only use source maps when running unit tests in debug mode (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Press authored Dec 4, 2017
1 parent 122e0c9 commit 06e390d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion build/webpack.karma.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
require('babel-polyfill');

const { argv } = process;
const isDebug = argv.find((arg) => {
return arg === '--auto-watch' || arg === '--no-single-run';
});

const { IgnorePlugin } = require('webpack');
const commonConfig = require('./webpack.common.config');

const baseConfig = commonConfig('en-US');

const config = Object.assign(baseConfig, {
devtool: 'inline-source-map',
resolve: {
alias: {
sinon: 'sinon/pkg/sinon'
}
}
});

if (isDebug) {
config.devtool = 'inline-source-map';
}


config.plugins.push(
new IgnorePlugin(/react\/addons/),
new IgnorePlugin(/react\/lib\/ReactContext/),
Expand Down

0 comments on commit 06e390d

Please sign in to comment.