在webpack.config.js 中设置: devServer: { host: '127.0.0.1' disableHostCheck: true } 参考 https://www.v2ex.com/t/519971