Don’t use BundleAnalyzerPlugin in tests

release
Etienne Lemay 2017-08-17 10:31:32 -04:00
parent 4f9320a51f
commit 6d60239998
2 changed files with 22 additions and 11 deletions

View File

@ -62,7 +62,7 @@ module.exports = function(config) {
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
singleRun: true,
// Concurrency level
// how many browser should be started simultaneous

View File

@ -6,7 +6,7 @@ var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlug
var PROD = process.env.NODE_ENV === 'production';
var TEST = process.env.NODE_ENV === 'test';
module.exports = {
var config = {
entry: path.resolve('src/index.js'),
output: {
path: path.resolve('dist'),
@ -15,14 +15,7 @@ module.exports = {
libraryTarget: 'umd',
},
externals: !TEST && [{
'react': {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
}],
externals: [],
module: {
loaders: [
@ -53,8 +46,26 @@ module.exports = {
new webpack.DefinePlugin({
EMOJI_DATASOURCE_VERSION: `'${pack.devDependencies['emoji-datasource']}'`,
}),
new BundleAnalyzerPlugin({ analyzerMode: 'static', openAnalyzer: false })
],
bail: true,
}
if (!TEST) {
config.externals = config.externals.concat([
{
'react': {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
},
])
config.plugins = config.plugins.concat([
new BundleAnalyzerPlugin({ analyzerMode: 'static', openAnalyzer: false }),
])
}
module.exports = config