修改前
修改后
1、在config文件中
host: '0.0.0.0', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
2、package.json配置文件
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --host 0.0.0.0",
3、build文件夹下面的webpack.dev.conf.js文件
useLocalIp: true,
4、build文件夹下面的webpack.dev.conf.js文件地址访问
messages: [
`App runing at: `,
` - Local: http://localhost:${port}`,
` - Network: http://${require('ip').address()}:${port}`,
]
5、重启项目