-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
development.js
53 lines (49 loc) · 1.49 KB
/
development.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
const webpack = require('webpack')
const Base = require('./base')
const devServer = require('../dev_server')
const { outputPath: contentBase, publicPath } = require('../config')
module.exports = class extends Base {
constructor() {
super()
this.config.merge({
mode: 'development',
devtool: 'cheap-module-source-map'
})
if (process.env.WEBPACK_DEV_SERVER
&& process.env.WEBPACK_DEV_SERVER !== 'undefined') {
if (devServer.hmr) {
this.plugins.append('HotModuleReplacement', new webpack.HotModuleReplacementPlugin())
this.config.output.filename = '[name]-[hash].js'
}
this.config.merge({
devServer: {
clientLogLevel: 'none',
compress: devServer.compress,
quiet: devServer.quiet,
disableHostCheck: devServer.disable_host_check,
host: devServer.host,
port: devServer.port,
https: devServer.https,
hot: devServer.hmr,
contentBase,
inline: devServer.inline,
useLocalIp: devServer.use_local_ip,
public: devServer.public,
publicPath,
historyApiFallback: {
disableDotRule: true
},
headers: devServer.headers,
overlay: devServer.overlay,
stats: {
entrypoints: false,
errorDetails: true,
modules: false,
moduleTrace: false
},
watchOptions: devServer.watch_options
}
})
}
}
}