Live reload is a protocol for sending notifications to the browser for rebooting. But you need a browser plugin to listen and reboot, although you can opt out of the plugin using the script tag.
The gulp -livereload plugin refers only to the implementation of the pedal download server, you still need to serve files through the http server from gulp.
You can use the gulp module, which runs as gulp-connect .
However, if for some reason you are not tied to downloading, I suggest using a browser. Browsersync is a good alternative to cookies , which adds the ability to synchronize your browsing between browsers. Since it embeds the script tag in your html and listens on the socket, you don't need plugins to make it work. It works even on mobile devices.
A gulp task using a browser might look like this. Remember to add the browser package.json file
var browserSync = require('browser-sync').create(); gulp.task('serve', [] , function( cb ){ browserSync.init({ open: true , server: { baseDir: "src" } }); gulp.watch([ 'src/**/*' , ] , ['serve:reload'] ); }); gulp.task('serve:reload' , [] , function(){ browserSync.reload(); });
Mon villalon
source share