-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgruntfile.js
executable file
·72 lines (68 loc) · 1.35 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
63
64
65
66
67
68
69
70
71
72
'use strict';
module.exports = function(grunt) {
// Unified Watch Object
var watchFiles = {
serverJS: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js'],
mochaTests: ['app/tests/**/*.js'],
mochaInit: ['app/init/**/*.js']
};
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
serverJS: {
files: watchFiles.serverJS,
tasks: ['jshint'],
options: {
livereload: true
}
}
},
jshint: {
all: {
src: watchFiles.serverJS,
options: {
jshintrc: true
}
}
},
nodemon: {
dev: {
script: 'server.js',
options: {
ext: 'js,html',
watch: watchFiles.serverJS
}
}
},
concurrent: {
default: ['nodemon', 'watch'],
options: {
logConcurrentOutput: true
}
},
mochaTest: {
test: {
src: watchFiles.mochaTests,
options: {
reporter: 'spec',
require: 'server.js'
}
},
init: {
src: watchFiles.mochaInit,
options: {
reporter: 'spec',
require: 'server.js'
}
}
}
});
// Load NPM tasks
require('load-grunt-tasks')(grunt);
// Making grunt default to force in order not to break the project.
grunt.option('force', true);
grunt.registerTask('default', ['concurrent:default']);
grunt.registerTask('test', ['mochaTest']);
grunt.registerTask('init', ['mochaTest:init']);
};