vue-cli 解决Invalid Host header

  • Post author:
  • Post category:vue


在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

加上这段

}



版权声明:本文为xiaozhi_2016原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。