-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathGruntfile.js
104 lines (102 loc) · 2.72 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
'use strict';
module.exports = function(grunt) {
require('time-grunt')(grunt);
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
js: {
files: ['gruntfile.js', 'application.js', 'lib/**/*.js', 'test/**/*.js'],
options: {
livereload: {
port: 35732
}
}
}
},
nodemon: {
dev: {
script: 'application.js',
options: {
args: [],
ignore: ['public/**'],
ext: 'js,html',
nodeArgs: [],
delayTime: 1,
env: {
PORT: 3000,
NODE_ENV: 'development'
},
cwd: __dirname
}
}
},
concurrent: {
serve: ['nodemon', 'watch'],
debug: ['node-inspector', 'shell:debug', 'open:debug'],
options: {
logConcurrentOutput: true
}
},
env: {
options: {},
// environment variables - see https://github.com/jsoverson/grunt-env for more information
local: {
FH_USE_LOCAL_DB: true,
FH_PORT: 8002,
FH_MONGODB_CONN_URL: 'mongodb://localhost:27017/raincatcher-demo-auth-session-store',
FH_SERVICE_MAP: function() {
/*
* Define the mappings for your services here - for local development.
* You must provide a mapping for each service you wish to access
* This can be a mapping to a locally running instance of the service (for local development)
* or a remote instance.
*/
var serviceMap = {
'SERVICE_GUID_1': 'http://127.0.0.1:8010',
'SERVICE_GUID_2': 'https://host-and-path-to-service'
};
return JSON.stringify(serviceMap);
}
}
},
'node-inspector': {
dev: {}
},
mochaTest: {
test: {
options: {
run: true
},
src: ['test/unit/*.js', 'lib/**/*spec.js']
}
},
shell: {
debug: {
options: {
stdout: true
},
command: 'env NODE_PATH=. NODE_ENV=development node --debug-brk application.js'
}
},
open: {
debug: {
path: 'http://127.0.0.1:8080/debug?port=5858',
app: 'Google Chrome'
}
},
eslint: {
src: ['*.js', 'lib/**/*.js', 'test/**/*.js']
}
});
// Load NPM tasks
require('load-grunt-tasks')(grunt, {
scope: 'devDependencies'
});
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-eslint');
grunt.registerTask('unit', ['eslint','mochaTest']);
grunt.registerTask('serve', ['env:local', 'concurrent:serve']);
grunt.registerTask('debug', ['env:local', 'concurrent:debug']);
grunt.registerTask('default', ['serve']);
};