-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.test.config.js
42 lines (37 loc) · 993 Bytes
/
webpack.test.config.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
const path = require('path');
const webpack = require('webpack');
module.exports = {
devtool: 'inline-source-map',
module: {
loaders: [
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.css$/, loader: 'null-loader' },
{ test: /\.jsx?$/, loader: 'babel', exclude: [/node_modules/] },
{
test: /\.jsx?$/,
loader: 'babel',
exclude: [/node_modules/, /specs/],
query: { plugins: ['istanbul'] }
},
{ test: /\.jpe?g$|\.gif$|\.png$|\.svg$/i, loader: 'null-loader' }
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
}
})
],
resolve: {
root: path.resolve(__dirname, 'app'),
modulesDirectories: ['app', 'node_modules'],
extensions: ['', '.js', '.jsx']
},
externals: {
jsdom: 'window',
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': 'window'
}
};