是否可以在 gruntfile 或命令提示符中指定特定的浏览器(除了操作系统的默认浏览器)?例如。 “grunt server firefox”之类的。我的默认浏览器是 Chrome,但我想在多个浏览器中测试/开发我的网站。我在 Yeoman 中使用 GruntJS。
布莱恩
最佳答案
快速回答
在 Gruntfile.js
您可以添加 app
范围:
open: {
server: {
url: 'http://localhost:<%= connect.options.port %>',
app: 'firefox'
}
},
拉取请求:https://github.com/jsoverson/grunt-open/pull/7
提交:https://github.com/GabLeRoux/grunt-open/commit/6f2c7069767e58160ec96aaaa8fa20ed210ba183
命令行参数
可以在应用字符串中传递命令行参数,例如
app: "chromium-browser --incognito"
- @bk11425
关于gruntjs - 使用各种浏览器运行 grunt 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17430291/