forked from trazyn/weweChat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
37 lines (27 loc) · 1.03 KB
/
webpack.config.dev.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
import webpack from 'webpack';
import config from './index';
import baseConfig from './webpack.config.base';
const { host, port } = config.server;
export default {
...baseConfig,
mode: 'development',
devtool: 'cheap-module-eval-source-map',
entry: [
`webpack-hot-middleware/client?path=http://${host}:${port}/__webpack_hmr`,
'babel-polyfill',
`${config.client}/app.js`,
],
output: {
...baseConfig.output,
publicPath: `http://${host}:${port}/dist/`,
},
plugins: [
// “If you are using the CLI, the webpack process will not exit with an error code by enabling this plugin.”
// https://github.com/webpack/docs/wiki/list-of-plugins#noerrorsplugin
new webpack.NoEmitOnErrorsPlugin(),
// https://webpack.github.io/docs/hot-module-replacement-with-webpack.html
new webpack.HotModuleReplacementPlugin(),
],
// https://github.com/chentsulin/webpack-target-electron-renderer#how-this-module-works
target: 'electron-renderer'
};