vue-cli 解决Invalid Host header

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiaozhi_2016/article/details/82855173

在webpack.dev.conf.js中添加:disableHostCheck: true

devServer: {

 public: 'local.kingsum.biz',

 clientLogLevel: 'warning',

 historyApiFallback: true,

hot: true,

compress: true,

host: HOST || config.dev.host,

port: PORT || config.dev.port,

open: config.dev.autoOpenBrowser,

overlay: config.dev.errorOverlay

? { warnings: false, errors: true }

: false,

publicPath: config.dev.assetsPublicPath,

proxy: config.dev.proxyTable,

quiet: true, // necessary for FriendlyErrorsPlugin

watchOptions: {

poll: config.dev.poll,

},

disableHostCheck: true     加上这段

}

猜你喜欢

转载自blog.csdn.net/xiaozhi_2016/article/details/82855173