-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
60 lines (51 loc) · 1.46 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
var path = require('path');
require( 'dotenv' ).load();
module.exports = function( grunt ) {
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
express: {
dev: {
options: {
script: 'server/server.js',
node_env: 'development',
}
},
production: {
options: {
background: false,
script: 'server/server.js',
node_env: 'production',
}
},
},
jshint: {
options: {
reporter: require( 'jshint-stylish' ),
},
dev: [ 'Gruntfile.js', './server/*.js', './server/**/*.js' ],
production: [ 'Gruntfile.js', './server/*.js', 'server/**/*.js' ],
},
watch: {
options: {
livereload: true,
//atBegin: true,
},
express: {
files: [ 'server/*.js', 'server/**/*.js' ],
tasks: [ 'dev_build', 'express:dev' ],
options: {
spawn: false,
}
},
},
});
grunt.loadNpmTasks( 'grunt-notify' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-express-server' );
grunt.registerTask( 'default', [ 'dev' ] );
grunt.registerTask( 'dev_build', [ 'jshint:dev' ] );
grunt.registerTask( 'dev', [ 'dev_build', 'express:dev', 'watch:express' ] );
grunt.registerTask( 'prod_build', [ 'jshint:production' ] );
grunt.registerTask( 'prod', [ 'prod_build', 'express:production' ] );
};