-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
49 lines (46 loc) · 1.15 KB
/
webpack.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
43
44
45
46
47
48
49
const webpack = require('webpack');
const mainBabelOptions = {
plugins: ['transform-runtime'],
presets: [
// 'es2015',
'stage-0',
'airbnb',
],
sourceMap: 'inline'
};
module.exports = {
module: {
rules: [
// This is the development configuration.
// It is focused on developer experience and fast rebuilds.
{
test: /\.json$/,
loader: 'json-loader',
},
// Process JS with Babel (transpiles ES6 code into ES5 code).
{
test: /\.(js|jsx)$/,
loader: 'babel-loader',
exclude: /\/node_modules\//,
options: mainBabelOptions,
},
],
},
externals: {
// cheerio: 'window',
// 'react-dom/server': 'window',
cheerio: 'window',
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true,
},
plugins: [
// Conditional requires workaround
// https://github.com/airbnb/enzyme/issues/47
// https://github.com/airbnb/enzyme/blob/master/docs/guides/webpack.md
// new webpack.IgnorePlugin(/react\/addons/),
// new webpack.IgnorePlugin(/react\/lib\/ReactContext/),
// new webpack.IgnorePlugin(/react\/lib\/ExecutionEnvironment/)
],
stats: 'errors-only',
};