Skip to content

Commit 0937899

Browse files
committed
Switched to grunt-express-server from grunt-express and added grunt watch express task.
1 parent 3f20e01 commit 0937899

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

Gruntfile.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ module.exports = function(grunt) {
22
grunt.initConfig({
33
pkg: grunt.file.readJSON('package.json'),
44
express: {
5-
custom: {
5+
dev: {
66
options: {
77
port: 3000,
8-
bases: 'public',
9-
server: 'app.js'
8+
script: 'app.js'
109
}
1110
}
1211
},
@@ -21,14 +20,21 @@ module.exports = function(grunt) {
2120
css: {
2221
files: '**/*.scss',
2322
tasks: ['sass']
23+
},
24+
express: {
25+
files: [ 'app.js', 'routes/*.js' ],
26+
tasks: [ 'express:dev' ],
27+
options: {
28+
spawn: false // for grunt-contrib-watch v0.5.0+, "nospawn: true" for lower versions. Without this option specified express won't be reloaded
29+
}
2430
}
2531
}
2632
});
2733

2834
grunt.loadNpmTasks('grunt-npm-install');
29-
grunt.loadNpmTasks('grunt-express');
30-
grunt.loadNpmTasks('grunt-contrib-sass');
3135
grunt.loadNpmTasks('grunt-contrib-watch');
36+
grunt.loadNpmTasks('grunt-express-server');
37+
grunt.loadNpmTasks('grunt-contrib-sass');
3238
grunt.registerTask('build-dev', ['npm-install']);
33-
grunt.registerTask('dev', ['express', 'watch', 'express-keepalive']);
39+
grunt.registerTask('dev', ['express:dev', 'watch']);
3440
}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"debug": "~0.7.4",
99
"dotenv": "^0.4.0",
1010
"express": "~4.2.0",
11+
"grunt-express-server": "^0.4.19",
1112
"jade": "~1.3.0",
1213
"morgan": "~1.0.0",
1314
"serve-favicon": "^2.0.1",

0 commit comments

Comments
 (0)