devServer

1.devServer基本配置

  • 开发环境下自动编译,自动打开浏览器
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
module.exports = {
// 开发服务器, 在开发过程中热加载项目
devServer: {
// 构建后的项目运行的目录
contentBase: path.resolve(dirs.build),
// 启动gzip压缩
compress: true,
// 端口号
port: 8100,
// 自动打开浏览器
open: false,
}
}
}

Comments