- 首先 找到 C:\Windows\System32\drivers\etc 打开hosts文件
- 在mainfest.json配置
“domain” : “http://xxx.com/”, //服务器域名
“devServer” : {
“port” : 80,
“disableHostCheck” : true
}
3. 先运行H5项目到普通浏览器,会提示请在微信客户端打开链接
4. 然后运行到小程序,切换调试模式,切换成公众号调试
5. 在上面的地址输入你的服务器域名,就可以本地调试了