1:首先全局安装BrowserSync : npm/cnpm install -g browser-sync
2:在项目文件夹下运行:
静态页面:browser-sync start --server --files "css/*.css, *.html"
动态页面:browser-sync start --proxy “localhost:2020(本地端口)”--files "css/*.css, *.html"
3:通过域名/文件夹名/HTML文件;例:http://192.168.33.10086:3000/index.html