-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathwebpack.dev.conf.js
55 lines (50 loc) · 1.22 KB
/
webpack.dev.conf.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
47
48
49
50
51
52
53
54
55
const path = require('path'),
webpack = require('webpack'),
UglifyJSPlugin = require("uglifyjs-webpack-plugin"),
HtmlWebpackPlugin = require("html-webpack-plugin"),
config = require('./webpack.config.js');
const _PROD_ = process.env.NODE_ENV === 'production'
config.mode = _PROD_ ? 'development' : 'none'
config.watchOptions = {
aggregateTimeout: 300,
poll: 1000,
}
config.devServer = {
port: '9100',
host: 'localhost',
proxy: [{
context: ['/api', '/uploads'],
target: 'http://127.0.0.1:9901'
}],
historyApiFallback: true,
static: {
directory: path.join(__dirname, 'public'),
},
// contentBase: path.join(__dirname, '../dist'),
// publicPath: '/',
// inline: true,
// stats: {
// colors: true
// },
client: {
// progress: true,
overlay: {
warnings: false,
errors: true,
},
},
// hot: true,
// hotOnly: true,
}
config.plugins = (config.plugins || []).concat([
new webpack.HotModuleReplacementPlugin(),
// new webpack.NamedModulesPlugin(),
new HtmlWebpackPlugin({
title: 'CMS-FE DEV',
filename: 'index.html',
template: '../src/template/index_base.html',
inject: 'body',
templateParameters: false,
})
]);
module.exports = config;