-
Notifications
You must be signed in to change notification settings - Fork 420
/
webpack.config.test.js
44 lines (36 loc) · 1.06 KB
/
webpack.config.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* eslint-env node */
/* `webpack.config.test` can be used for contributing/developing and testing. */
const webpack = require('webpack');
const hotMiddlewareScript =
'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000&reload=true';
const StringReplacePlugin = require('string-replace-webpack-plugin');
const config = require('./webpack.config');
config.entry = {
'browser-tests': ['./tests/browser-tests.js', hotMiddlewareScript],
};
// used by enzyme
config.externals = {
'react/lib/ReactContext': true,
'react/lib/ExecutionEnvironment': true,
'react/addons': true,
cheerio: 'window',
};
config.devtool = 'eval-source-map';
config.output = {
libraryTarget: 'umd',
path: `${__dirname}/test-build/`,
publicPath: '/test-build/',
// [name] is config.entry object keys
filename: '[name].bundle.js',
};
config.performance = {
hints: false,
};
config.plugins = [
new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify('development') },
}),
new StringReplacePlugin(),
new webpack.HotModuleReplacementPlugin(),
];
module.exports = config;