-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
37 lines (33 loc) · 1.1 KB
/
webpack.config.dev.js
File metadata and controls
37 lines (33 loc) · 1.1 KB
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
const webpack = require('webpack');
const path = require('path');
const merge = require('webpack-merge');
import base from './webpack.config.common';
const port = 3000;
const config = merge(
base,
{
entry: ['react-hot-loader/patch',
'webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000',
path.join(__dirname, 'src/index')
],
devServer: {
contentBase: [path.resolve(__dirname, 'src'), path.resolve(__dirname, 'public', 'assets'), path.resolve(__dirname, 'public', 'assets', 'images')],
historyApiFallback: true,
hot: true,
overlay: true,
port: port,
publicPath: '/',
before(app) {
app.use(express.static(path.join(__dirname, 'src', 'assets', 'images')))
}
},
devtool: 'eval-source-map',
mode: 'development',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.NoEmitOnErrorsPlugin()
]
}
);
module.exports = config;