【发布时间】:2014-09-25 15:16:15
【问题描述】:
我正在尝试使用grunt-contrib-less 和grunt-contrib-watch 设置grunt-notify。一般来说,这运行良好,但当 grunt-less 成功执行时,我无法让 grunt-notify 通知我。
如果有人对如何设置或调试有任何见解,很高兴有任何意见。
完整信息:
我已经设置了 grunt-notify 以在 less 使用手表运行时触发。当较少的任务失败时,这很有效。给我一个很大的弹出错误:
作为参考,这是控制台输出:
当 less 成功时,我没有收到任何通知。我想收到通知,但不知道如何启用它。
这是less成功时的控制台输出:
这是我正在使用的 GruntFile:
module.exports = function(grunt) {
grunt.initConfig({
less: {
development: {
options: {
compress: true
},
files: {
"FILE.css": "FILE2.less"
}
}
},
watch: {
less: {
files: '**/*.less',
tasks: ['less', 'notify_hooks']
}
},
notify_hooks: {
options: {
message: "MESSAGE"
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-notify');
grunt.registerTask("default", ['less']);
};
【问题讨论】:
标签: javascript gruntjs less grunt-contrib-watch grunt-notify