-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.dev.config.js
44 lines (37 loc) · 1.15 KB
/
webpack.dev.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
const webpack = require('webpack');
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
const betterWebpackProgress = require('better-webpack-progress');
const webpackConfig = require('./webpack.config.js');
const WEBPACK_PORT = process.env.WEBPACK_PORT || 4000;
module.exports = Object.assign({}, webpackConfig, {
mode: 'development',
devtool: 'cheap-module-eval-source-map',
entry: [
`webpack-dev-server/client?http://localhost:${WEBPACK_PORT}`,
'webpack/hot/only-dev-server',
...webpackConfig.entry,
],
output: Object.assign({}, webpackConfig.output, {
publicPath: '/',
}),
optimization: {},
plugins: [
...webpackConfig.plugins,
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.ProgressPlugin(betterWebpackProgress({ mode: 'bar' })),
new FriendlyErrorsPlugin({ clearConsole: true }),
],
});
module.exports.devServer = {
host: '0.0.0.0',
port: WEBPACK_PORT,
historyApiFallback: true,
logLevel: 'silent',
clientLogLevel: 'none',
stats: 'errors-only',
hot: true,
inline: true,
overlay: true,
};