web 移动端开发手机查看效果

时间:2021-05-30 18:17:09

package.json 中

"scripts": {
    "test": "echo "Error: no test specified" && exit 1",
    "dev": "webpack-dev-server --open --port 3000 --contentBase src --hot --host 192.168.0.106",
    "dev1": "webpack-dev-server"
  },
添加 --host 加当前局域网ip
"dev": "webpack-dev-server --open --port 3000 --contentBase src --hot --host 192.168.0.106"