Here is my gulpfile.js:
var gulp = require('gulp'),
nodemon = require('gulp-nodemon'),
plumber = require('gulp-plumber'),
livereload = require('gulp-livereload');
gulp.task('develop', function () {
livereload.listen();
nodemon({
script: 'app.js',
ext: 'js ejs html coffee'
}).on('restart',function() {
console.log('Livereload reload...');
livereload.reload();
});
});
gulp.task('default', [
'develop'
]);
My app.js:
var express = require('express');
var app = express();
app.set('view engine','ejs');
app.get('/', function(req,res){
res.send('Hello world!');
});
app.listen(8888, function() {
console.log('Server started at 8888');
});
When I change 'Hello world!' to 'Hello world!!!!!', I can see the following in my console:
It did logged my changes. But the page is not reloaded at all. I have to refresh my browser to see the change. Anything wrong in my gulpfile.js? Any idea? Thanks.