grunt-open插件-tasks目录下open.js文件中配置了一个open任务:
grunt.registerMultiTask('open', 'Open urls and files from a grunt task', function() {
var dest = this.data.url || this.data.file || this.data.path;
dest = typeof dest === 'function' ? dest() : dest;
var application = this.data.app || this.data.application;
var options = this.options();
function callback(error){
if (error !== null)
grunt.fail.warn(error);
}
options.delay = options.delay || 0;
// allows to wait for server start up before opening
var openOn = options.openOn;
if (openOn) {
grunt.event.on(openOn, function () {
open(dest, application, callback);
});
} else {
setTimeout(function(){
open(dest, application, callback);
}, options.delay);
}
// give the spawn some time before its parent (us) dies
// https://github.com/onehealth/grunt-open/issues/6
setTimeout(this.async(), 200);
});
grunt.initConfig({
open: {
server : {
path : 'http://127.0.0.1:9999',
app : 'Google Chrome Canary'
}
},
这样执行 grunt open:server 命令时就可以成功使用'Google Chrome Canary'浏览器打开网址。
https://github.com/jsoverson/grunt-open
分享到:
相关推荐
grunt-cli的0.1.13版本压缩包,里面带有node_modules等目录。供有需要的人使用。
grunt-electron-installer, 为电子应用构建 Windows 安装程序的插件插件 电子安装程序Grunt插件 Grunt插件,为电子应用程序构建 Windows 安装程序,使用 ...安装npm install --save-dev grunt-electron-installer配置
grunt运行的命令行 放在C:\Users\Administrator\AppData\Roaming\npm\node_modules\grunt-cli下的
grunt-contrib-copy, 复制文件和文件夹 grunt-contrib-copy-v1.0.0 复制文件和文件夹正在启动If之前,请务必先查看一下如何创建 Gruntfile插件,以及安装和使用Grunt插件。 熟悉该过程后,你可以使用以下命令安装...
使用grunt-babel 转换es6 到es5依赖库
grunt-bower-task, 面向 Bower的Grunt插件 grunt-bower-task 安装 Bower 软件包明智地安装。正在启动注意:如果你以前没有使用过 grunt,那么一定要检查一下 guide指南 guide 。 请注意,这里插件仅使用 grunt 的
grunt-ssh, SSH,Grunt的SFTP任务 新主人 启动 12 -23-2015,我正站在两个巨人( @chuckmo和 @andrewrjones) 作为这个项目维护者的肩膀上) 。 欢迎捐赠,如往常。 ( 这里消息也将在下一次发布时删除) 。静音 ssh
前端开源库-grunt-cmd-transport-wndgrunt cmd传输wnd,将javascript传输到cmd。
前端开源库-grunt-inline-angular-templates咕哝内联角度模板,内联角度模板到HTML文件中
前端开源库-grunt-es6-transpilerGrunt-ES6-蒸腾器,蒸腾ES6至ES5
前端开源库-grunt-obfuscator-node咕哝模糊节点,模糊节点通过咕哝项目
grunt-cache-bust, 使用内容散列缓存 static 资产 grunt-cache-bust 使用内容散列从高速缓存中触发 static 资产正在开始运行。简介是如何工作的。选项用法示例更改日志记录请阅读这里插件最近升级到 v1.0.0 ! 插件...
前端开源库-grunt-contrib-testemgrunt contrib testem,testem程序化运行程序,通过切碎机预处理增强
前端开源库-grunt-connect-proxygrunt connect proxy,提供一个HTTP代理作为grunt connect的中间件。
前端开源库-grunt-transport-pas咕哝传输pas,将javascript传输到cmd。
grunt-cli-main.zip
grunt-responsive-images, 针对响应式网站的不同大小,生成图像 grunt-responsive-images 生成不同大小的图像正在启动这个插件需要 Grunt ~0.4.5 。If之前,请务必先查看一下如何创建 Gruntfile插件,以及安装和使用...
grunt-contrib-茉莉花v2.2.0 通过无头Chrome轻松运行茉莉花规格 入门 如果您以前从未使用过 ,请务必查看《指南》,因为它说明了如何创建以及安装和使用Grunt插件。 熟悉该过程后,可以使用以下命令安装此插件: ...
loadNpmTasks ( 'grunt-contrib-uglify' ) ; grunt . loadNpmTasks ( 'grunt-contrib-jshint' ) ; grunt . loadNpmTasks ( 'grunt-contrib-watch' ) ; grunt . loadNpmTasks ( 'grunt-...' ) ; grunt . loadTasks ...
grunt-angular-architecture-graph, 在. dot 格式中,生成模块依赖关系图 使用angular-architecture-graph创建 Angular 项目的图表。正在启动这个插件需要 Grunt ~0.4.5If之前,请务必先查看一下如何创建 Gruntfile...