forked from salesforce/design-system-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.test.js
40 lines (33 loc) · 1.01 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
/* 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 = {
tests: ['./components/tests-bundle.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.plugins = [
new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify('development') }
}),
new StringReplacePlugin(),
new webpack.HotModuleReplacementPlugin()
];
module.exports = config;