我正在将 grunt-contrib-connect 用于本地开发服务器,并想编写一个任务以在服务器启动后启动 google chrome。但是想要传递以下参数以在不安全模式下打开它。
--args --disable-web-security --user-data-dir
我尝试了 grunt-open 来做到这一点,但没有找到任何传递标志的选项。
任何帮助表示赞赏。
我正在将 grunt-contrib-connect 用于本地开发服务器,并想编写一个任务以在服务器启动后启动 google chrome。但是想要传递以下参数以在不安全模式下打开它。
--args --disable-web-security --user-data-dir
我尝试了 grunt-open 来做到这一点,但没有找到任何传递标志的选项。
任何帮助表示赞赏。
你应该能够用grunt-exec
它来做你需要的事情。像这样的配置对我有用:
grunt.config.init({
...
exec: {
chrome: {
cmd: '"C:/Program Files (x86)/Google/Chrome/Application/chrome" --incognito http://washingtonpost.com'
}
}
...
});
请注意,在 Windows 上,可执行文件的路径需要引号。如果您有幸使用不那么烦人的操作系统,您将不需要它们。