How to use the browser-sync.reload function in browser-sync

To help you get started, we’ve selected a few browser-sync 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 AGProjects / sylk-webrtc / gulp / tasks / scripts.js View on Github external
// Report compile errors
        .on('error', notify.onError({
          title: "JS Compile Error",
          message: "<%= error.message %>"
        }))
        // Use vinyl-source-stream to make the
        // stream gulp compatible. Specify the
        // desired output filename here.
        .pipe(source(bundleConfig.outputName))
        .pipe(buffer())
          .pipe(sourcemaps.init()) // loads map from browserify file
          .pipe(sourcemaps.write('./')) // writes .map file
        // Specify the output destination
        .pipe(gulp.dest(bundleConfig.dest))
        .on('end', reportFinished)
        .pipe(browserSync.reload({stream:true}));
    };
github zellwk / gulp-starter-csstricks / gulpfile.js View on Github external
gulp.task('sass', function() {
  return gulp.src('app/scss/**/*.scss') // Gets all files ending with .scss in app/scss and children dirs
    .pipe(sass().on('error', sass.logError)) // Passes it through a gulp-sass, log errors to console
    .pipe(gulp.dest('app/css')) // Outputs it in the css folder
    .pipe(browserSync.reload({ // Reloading with Browser Sync
      stream: true
    }));
})
github Gaya / queryloader2 / gulpfile.js View on Github external
gulp.task('browserify', function() {
    'use strict';
    return browserify('./' + config.src + '/main.js')
        .bundle()
        .on('error', function (err) {
            console.log(err.toString());
            this.emit('end');
        })
        .pipe(source(pkg.name + '.js'))
        .pipe(gulp.dest(config.dist))
        .pipe(browserSync.reload({stream:true}));
});
github nathanielw / nz-flag-graph / gulpfile.js View on Github external
gulp.task('css', function() {
	return gulp.src('src/scss/*.scss')
		.pipe(sass({includePaths: ['./node_modules/'], outputStyle: 'compressed' }))
		.on('error', gutil.log.bind(gutil, 'Sass Error'))
		.pipe(autoprefixer({
			browsers: ['> 0.5% in NZ', 'last 2 versions'],
			cascade: false
		}))
		.pipe(gulp.dest(opts.dest + '/css'))
		.pipe(browserSync.reload({stream: true}));
});
github jeshan / lambda-checklist / gulpfile.babel.js View on Github external
gulp.task('browser-reload', () => {
  browserSync.reload();
});
github banthagroup / fslightbox / gulpfile.js View on Github external
gulp.task('sass', function () {
    return gulp.src('src/scss/FsLightbox.scss')
        .pipe(sass().on('error', sass.logError))
        .pipe(gulp.dest('src/css'))
        .pipe(browserSync.reload({stream: true}));
});
github AngularStudyGroup / afs / gulpfile.js View on Github external
gulp.task('styles', ['sass'], function () {
    return gulp.src(config.app + 'content/css')
        .pipe(browserSync.reload({stream: true}));
});
github ng-tools / ng-factory / lib / tasks / docs / scripts.js View on Github external
gulp.task('ng:docs/scripts', function() {
    return merge(gulp.src(docs.scripts, {cwd: docs.cwd, base: docs.cwd}), gulp.src(docs.scripts, {cwd: cwd, base: cwd}))
      .pipe(plumber(config.plumberErrorHandler))
      .pipe(channels.scripts.src(gulp, config)(docs))
      .pipe(reload({stream: true}));
  });
github FlexSearch / FlexSearch / srcjs / gulp / watch.js View on Github external
gulp.watch('{' + options.src + ',' + options.common + '}' + '/**/*.html', function(event) {
      browserSync.reload(event.path);
    });
  });
github yogasaikrishna / foopicker / gulpfile.js View on Github external
gulp.task('sass', function() {
  var styles = gulp.src('scss/**/*.scss')
                .pipe(sass({outputStyle: 'expanded'})
                .on('error', sass.logError));
  if (options.minify) {
    styles.pipe(minifyCss());
  }
  styles.pipe(gulp.dest(options.dest))
    .pipe(browserSync.reload({
      stream: true
    }));
});