-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.js
46 lines (41 loc) · 1.07 KB
/
webpack.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
38
39
40
41
42
43
44
45
46
const { merge } = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { DefinePlugin } = require('webpack');
const common = require('./webpack.common');
const commonWebpackConstants = require('./webpackConstants/common');
const developmentWebpackConstants = require('./webpackConstants/development');
const finalWebpackConstants = {
...commonWebpackConstants,
...developmentWebpackConstants,
};
Object.keys(finalWebpackConstants).forEach((key) => {
finalWebpackConstants[key] = JSON.stringify(finalWebpackConstants[key]);
});
module.exports = merge(common, {
mode: 'development',
devtool: 'eval-source-map',
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html',
}),
new DefinePlugin({
...finalWebpackConstants,
}),
// new HotModuleReplacementPlugin(),
],
stats: {
colors: true,
reasons: true,
chunks: true,
},
devServer: {
client: {
progress: true,
},
host: '0.0.0.0',
port: 7000,
hot: true,
historyApiFallback: true,
compress: true,
},
});