How to use gulp-livereload - 10 common examples

To help you get started, we’ve selected a few gulp-livereload examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github redhat-cip / dci-control-server / dci / dci_databrowser / utils.js View on Github external
function server(root, port, livereload) {
  var d = Q.defer();
  var api = process.env.API_PORT_5000_TCP + '/api' || config.api;
  var app = connect();

  api = url.parse(api);
  // must be present here in the case of using docker compose
  api.protocol = 'http:';
  api.route = '/api';

  if (livereload) {
    var options = {host: config.host, port: 35729};
    require('gulp-livereload').listen(options, function() {
      gutil.log('Livereload started on port:',
                gutil.colors.green(options.port));
    });
    app.use(require('connect-livereload')({port: options.port}));
  }
  app.use(serveStatic(root));
  app.use(proxy(api));

  var server = http.createServer(app);
  closePromise(server);
  server
  .on('listening', function() {
    var connection = server._connectionKey.split(':');
    var address = {
      protocol: 'http',
      hostname: connection[1],
github koenoe / cocoen / gulpfile.js View on Github external
gulp.task('watch', function() {
  // Listen on port 35729
  livereload.listen(35729, function (err) {
    if (err) {
      return console.log(err);
    }

    gulp.watch([paths.js + '**/*.js'], ['js']);
    gulp.watch([paths.scss + '**/*.scss'], ['css']);
  });
});
github Baremetrics / calendar / gulpfile.js View on Github external
function watch(cb) {
  gulp.watch('dev/js/**/*.js', js);
  gulp.watch('dev/sass/**/*.scss', css);
  // gulp.watch('dev/img/**/*.{jpg,jpeg,png,gif,svg,ico}', img);
 
  livereload.listen();
  gulp.watch(['public/*.html', 'public/js/**/*.js', 'public/img/**/*.{jpg,jpeg,png,gif,svg,ico}', 'public/css/*.css']).on('change', livereload.changed);

  cb();
}
github DarkPark / stb / tpl / tasks / static.js View on Github external
gulp.watch([path.join(global.paths.build, '**', '*.{html,js,json,css}')]).on('change', function ( file ) {
				// report
				log('watch   '.bgCyan.black, 'reload ' + ('./' + path.relative(global.paths.build, file.path)).bold);
				// reload
				glr.changed(file);
			});
		}
github cheton / webappengine / gulp / tasks / watch.js View on Github external
gulp.task('watch', ['browserify-watch'], function() {

        gulp.watch(options.config.csslint.src, ['csslint']); // .css
        gulp.watch(options.config.eslint.src, ['eslint']); // .js or .jsx
        gulp.watch(options.config.jshint.src, ['jshint']); // .json

        // Start live reload server
        livereload.listen(35729);
    });
};
github dlueth / qoopido.demand / gulp / tasks / dist.js View on Github external
function watch() {
	livereload.listen();

	return gulp.watch(settings.watch, gulp.series(id + ':lint', id + ':build'))
		.on('unlink', function(file) {
			/*
			var relpath  = path.relative(path.resolve('src'), file),
				resolved = path.resolve('build', relpath);

			console.log(file, relpath, resolved);
			*/
			//del.sync(resolved);
		});
}
github dlueth / qoopido.demand / gulp / tasks / snippets.js View on Github external
function watch() {
	livereload.listen();

	return gulp.watch(settings.watch, gulp.series(id + ':lint', id + ':build'))
		.on('unlink', function(file) {
			/*
			var relpath  = path.relative(path.resolve('src'), file),
				resolved = path.resolve('build', relpath);

			console.log(file, relpath, resolved);
			*/
			//del.sync(resolved);
		});
}
github twalker / inline-styles / gulpfile.js View on Github external
]).on('change', function(file){
    //console.log(file.path + ' changed')
    livereload.changed(file)
  });
github mozillascience / software-discovery-dashboard / gulpfile.js View on Github external
this.stdout.on('data', function (chunk) {
            if(/^Express server listening on port/.test(chunk)){
                livereload.changed(__dirname);
            }
        });
        this.stdout.pipe(process.stdout);
github SAP / InfraBox / src / dashboard / gulpfile.js View on Github external
this.stdout.on("data", function(chunk) {
            if (/^Express server listening on port/.test(chunk)) {
                livereload.changed(__dirname);
            }
        });
        this.stdout.pipe(process.stdout);

gulp-livereload

Gulp plugin for livereload.

MIT
Latest version published 5 years ago

Package Health Score

57 / 100
Full package analysis

Popular gulp-livereload functions