before:可获取 node 服务 app 实例,执行中间件操作
comporess:打开 gzip 压缩服务器可访问内容。暂时认为开发环境不开比较好,易于调试。
contentbase(非常重要):Tell the server where to serve content from。可传多个路径,建议用绝对路径。
publicPath:determine where the bundles should be served from(把 bundled 文件放在定义目录下,默认为 ‘/’)
hot:是否开启热更新。设为 true 则会自动加载插件 : webpack.HotModuleReplacementPlugin
hotOnly:页面返回时是否不刷新页面,以防页面构建失败。
https:是否开启 https。
historyApiFallback :解决刷新页面出现 404 的问题?参考、参考2
quiet:设置为 true 时,console 只显示初始启动信息, webpack 报错和告警都不会显示。
stats:如果希望显示部分 bundle 信息,可设置该属性,详情文档
watchContentBase:让 server 监听 contentbase 内文件变化,从而触发页面刷新
网友评论