Javascript GrunFile.js-grunt.registerTask
不确定我是否做对了Javascript GrunFile.js-grunt.registerTask,javascript,task,gruntjs,runner,Javascript,Task,Gruntjs,Runner,不确定我是否做对了 module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json') , connect: { server: { options: { port: 8001 , hostname: 'localhost' ,
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json') ,
connect: {
server: {
options: {
port: 8001 ,
hostname: 'localhost' ,
base: 'www-root/app/public' ,
keepalive: true
}
}
} ,
jade: {
files: {
src: 'app/components/jade/index.jade' ,
dest: 'app/public/index.html'
}
} ,
compass: {
options: {
config: 'config.rb'
}
} ,
watch: {
css: {
files: '**/*.sass' ,
tasks: ['sass'] ,
options: {
livereload: true
}
} ,
jade: {
files: 'app/components/**/*.jade' ,
tasks: ['jade'] ,
options: {
livereload: true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jade');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['connect', 'jade', 'compass', 'watch']);
}
每次我运行grunt时,它只向我显示连接任务,而没有其他任何事情发生,例如当我更改index.jade文件时。。。是我按顺序组织任务的方式有问题,还是应该添加异步运行任务的内容
我不知道该怎么办。。谢谢
keepalive:使服务器无限期地保持活动状态。请注意,如果启用此选项,则在此任务之后指定的任何任务将永远不会运行
因此,您需要在“默认”分配中重新排列任务列表:
grunt.registerTask('default', ['jade', 'compass', 'connect']);
或者类似的东西。希望有帮助;)
keepalive:使服务器无限期地保持活动状态。请注意,如果启用此选项,则在此任务之后指定的任何任务将永远不会运行
因此,您需要在“默认”分配中重新排列任务列表:
grunt.registerTask('default', ['jade', 'compass', 'connect']);
或者类似的东西。希望有帮助;) 我能知道它为什么被无故否决吗?我能知道它为什么被无故否决吗?