当它应该看的时候Grunt退出 [英] Grunt Exiting When It Should Be Watching
本文介绍了当它应该看的时候Grunt退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的 Gruntfile.js
:
module.exports = function(grunt){
grunt.initConfig({
watch:{
js:{
文件:[
'index.js',
'brains.js',
'lib / *。js'
],
任务:['develop'],
选项:{nospawn:true}
}
},
开发:{
server:{
file :'index.js'
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-develop');
grunt.registerTask('default',['develop']);
};
当我执行grunt时,它声明它已经完成并退出。如何在基于网络的节点应用程序中保持警惕?
当您调用时, grunt
,默认任务正在运行: grunt.registerTask('default',['develop']);
。运行 grunt watch
,或将 ['develop']
更改为 ['watch']。
。 I am developing a node app that interacts with IRC.
My Gruntfile.js
:
module.exports = function(grunt) {
grunt.initConfig({
watch: {
js: {
files: [
'index.js',
'brains.js',
'lib/*.js'
],
tasks: ['develop'],
options: { nospawn: true }
}
},
develop: {
server: {
file: 'index.js'
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-develop');
grunt.registerTask('default', ['develop']);
};
When I execute grunt it states that it completed and exits. How can I keep grunt watching like in a web based node app?
解决方案
When you're calling grunt
, the default task is running: grunt.registerTask('default', ['develop']);
. Run grunt watch
instead, or change ['develop']
to ['watch']
.
这篇关于当它应该看的时候Grunt退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文