1 Upgrade webpack-dev-server to the latest version.

2 Change webpack.config.js to 0.0.0.0

devServer: { ... , host:'0.0.0.0',},Copy the code

3 add –useLocalIp to dev command in package.json

After running, open these local IP addresses :port 0.0.0.0:port 127.0.0.1:port, whether on a computer or on a phone with the same LAN

All have correct access to our front-end projects