-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
78 lines (75 loc) · 2.28 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
73
74
75
76
77
78
// Invoke 'strict' JavaScript mode
'use strict';
module.exports = function(grunt) {
// Initialize the Grunt configuration
grunt.initConfig({
// Configure the grunt-env task
env: {
test: {
NODE_ENV: 'test'
},
dev: {
NODE_ENV: 'development'
}
},
// Configure the grunt-contrib-watch task
watch: {
options: {
livereload: true
},
js: {
files: ['server.js', 'config/**/*.js', 'app/**/*.js', 'public/js/*.js', 'public/modules/**/*.js']
}
},
nodemon: {
dev: {
script: 'index.js',
options: {
nodeArgs: ['--debug'],
watch: ['index.js', 'config/**/*.js', 'app/**/*.js'],
ignore: ['node_modules/**']
}
}
},
// Configure the grunt-contrib-jshint task
jshint: {
all: {
src: ['server.js', 'config/**/*.js', 'app/**/*.js', 'public/js/*.js', 'public/modules/**/*.js'],
options: {
node: true,
predef: [
"define",
"require",
"exports",
"module",
"describe",
"before",
"beforeEach",
"after",
"afterEach",
"it",
"inject",
"expect"
]
}
}
},
concurrent: {
dev: {
tasks: ['nodemon', 'watch'],
options: {
logConcurrentOutput: true
}
}
}
});
// Load the external tasks
grunt.loadNpmTasks('grunt-env');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-concurrent');
// Create the 'default' Grunt task
grunt.registerTask('default', ['env:dev', 'concurrent:dev']);
};