vue-cli5升级:运行时自动打开0:0:0:0地址且无法访问

  1. 背景:升级vue-cli5 + 配置devServer
  2. 关键代码:
devServer: {
    
    
    open: true
    port: 9800,
    https: false,
    ···
},
  1. 问题:open: true直接打开浏览器且未设置host地址时,默认host: '0.0.0.0'
  2. 解决:如果仍需自动打开浏览器页面则修改host
devServer: {
    
    
	host: 'local-ip' // 设置自动获取本机ip,但最后编译信息中地址也会显示为该字符串
    open: true
    port: 9800,
    https: false,
    ···
},

猜你喜欢

转载自blog.csdn.net/qq_44242707/article/details/127568432
0
今日推荐