打开package.json文件,找到下面的代码
"scripts": { "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", "start": "npm run dev", "build": "node build/build.js" },
改成
"scripts": { "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --host 192.168.0.114", "start": "npm run dev", "build": "node build/build.js" },
host后面是你的ip地址。