You can not access webpack local development projects within the LAN environment? ? ?

The investigation is because the new version of webpack-dev-server for security reasons, the default check hostname, if not the hostname in the configuration can not be accessed. Thus there are two methods, one is set to ignore host checks, one is disposed directly host your address.

1, host Close inspection

Webpack.dev.conf.js can build in the directory file, add the devServer disableHostCheck: true, skip check
2, the same principle may be modified in package.json scripts command file: webpack-dev-server --disableHostCheck = true

Reproduced in: https: //www.jianshu.com/p/b9a3aed59186

Guess you like

Origin blog.csdn.net/weixin_34281477/article/details/91182323