-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
54 lines (53 loc) · 1.1 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
50
51
52
53
54
const { resolve } = require('path');
const webpack = require('webpack');
module.exports = {
devtool: 'eval',
entry: {
app: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'react-hot-loader/patch',
'babel-polyfill',
resolve(__dirname, 'app/index.js'),
],
vendor: [
'react',
'react-dom',
'react-redux',
'react-router',
'redux',
'redux-saga',
],
},
output: {
path: resolve(__dirname, 'dist'),
filename: '[name].js',
publicPath: '/static/',
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
include: resolve(__dirname, 'app'),
},
],
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: Infinity,
filename: 'vendor.bundle.js',
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"development"',
}),
new webpack.HotModuleReplacementPlugin(),
],
resolve: {
modules: [
resolve('./app'),
resolve('./node_modules'),
],
},
};