-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.config.js
46 lines (42 loc) · 1.11 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
45
46
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const path = require('path');
const merge = require('webpack-merge');
const baseConfig = require('./webpack.base.config.js');
const devConfig = {
mode: "development",
// context: path.join(__dirname, 'src'),
output: {
publicPath: "",
chunkFilename: "[name].js",
filename: "[name].js"
},
optimization: {
runtimeChunk: {
name: "manifest"
},
splitChunks: {
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: "vendors",
priority: -20,
chunks: "all"
}
}
}
},
plugins: [
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin()
],
devServer: {
host: '0.0.0.0',
port: 2310,
contentBase: './dist',
hot: true,
historyApiFallback: true
},
devtool: 'inline-source-map',
};
module.exports = merge(baseConfig, devConfig);