Invalid Host header
关闭 Host 检查
build/webpack.dev.conf.js
{ devServer: { disableHostCheck: true } }
vue.config.js
{
devServer: {
disableHostCheck: true
}
}
package.json
{
"scripts": {
"dev": "webpack-dev-server --disableHostCheck=true"
}
}
设置 Host
- https://webpack.js.org/configuration/dev-server/#devserverhost
- https://webpack.js.org/configuration/dev-server/#devserverallowedhosts
- https://cli.vuejs.org/
- https://github.com/webpack/webpack-dev-server
{ devServer: { host: "example.com" } }
package.json
{
"scripts": {
"dev": "webpack-dev-server --host=example.com"
}
}