运行各种浏览器的grunt服务器 [英] Run grunt server with various browsers

查看:111
本文介绍了运行各种浏览器的grunt服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在gruntfile或命令提示符下指定特定的浏览器(除了操作系统的默认值)?例如。 grunt server firefox或类似的。我的默认浏览器是Chrome,但我想在多个浏览器中测试/开发我的网站。我在Yeoman内使用了GruntJS。

Bryan

解决方案



Gruntfile.js 中,您可以添加应用程序参数:

 打开:{
服务器:{
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


Is it possible to specify a particular browser (besides the OS' default) in the gruntfile or at the command prompt? E.g. "grunt server firefox" or the like. My default browser is Chrome, but I want to test/develop my site in multiple browsers. I am using GruntJS within Yeoman.

Bryan

解决方案

Quick Answer

In Gruntfile.js you can add an app parameter:

open: {
  server: {
    url: 'http://localhost:<%= connect.options.port %>',
    app: 'firefox'
  }
},

Pull request: https://github.com/jsoverson/grunt-open/pull/7

Commit: https://github.com/GabLeRoux/grunt-open/commit/6f2c7069767e58160ec96aaaa8fa20ed210ba183


Command Line Parameters

It is possible to pass command line parameters in the app string, such as app: "chromium-browser --incognito" - @bk11425

这篇关于运行各种浏览器的grunt服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆