-
Notifications
You must be signed in to change notification settings - Fork 29
/
webpack.config.js
40 lines (38 loc) · 1014 Bytes
/
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
var path = require('path')
module.exports = {
//devtool: 'source-map',
context: path.join(__dirname, "src"),
entry: [
'webpack/hot/only-dev-server',
'react-hot-loader/patch',
'./main'
],
output: {
filename: "app.js",
path: path.join(__dirname, "public")
},
externals: {
"react": "react",
"react-dom": "react-dom"
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['babel?{presets:["es2015", "react", "stage-2"], plugins:["react-hot-loader/babel"]}']
}
]
},
node: {
fs: "empty"
},
// we need this because of enzyme
// see https://github.com/airbnb/enzyme/blob/master/docs/guides/webpack.md
externals: {
'cheerio': 'window',
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
}
};