-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgruntfile.js
62 lines (56 loc) · 1.12 KB
/
gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
module.exports = function(grunt){
grunt.initConfig({
watch:{
jade:{
files:['/app/views/**'],
options:{
livereload:true
}
},
js:{
files:['public/js/**','models/**/*.js','schemas/**/*.js'],
//tasks:['jshint'],
options:{
livereload:true
}
}
},
nodemon:{
dev:{
script: 'app.js',
options:{
//files:'app.js',
args: ['dev'],
cwd: __dirname,
ignore: ['node_modules/**'],
watchedExtensions:['js'],
watchedFolders:['./'],
debug:true,
delayTime:1,
env:{
PORT:3000
}
}
}
},
concurrent:{
tasks:['nodemon','watch'],
options:{
logConcurrentOutput:true
}
},
mochaTest:{
options:{
reporter:'spec'
},
src:['test/**/*.js']
}
})
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-mocha-test');//做单元测试使用
grunt.option('force',true)//防止语法错误导致服务停机
grunt.registerTask('default',['concurrent'])//默认任务
grunt.registerTask('test',['mochaTest'])
}