How to use the browser-sync.use 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 flant / loghouse / images / tabix.ui / gulp / documentation.js View on Github external
gulp.task('docs', ['docs:generate'], function() {
	browserSync.use(browserSyncSpa({
		selector: '[ng-app]' // Only needed for angular apps
	}));

	browserSync.instance = browserSync.init({
		startPath: '/',
		server: {
			baseDir: './' + conf.paths.docs
		},
		port: 3010,
		browser: 'default'
	});
	gulp.watch(path.join(conf.paths.src, '/**/*.js'), function(event) {
		gulp.start('docs:generate');
		browserSync.reload(event.path);
	});
});
github azachar / screenshoter-report-analyzer / gulp / server.js View on Github external
* You can add a proxy to your backend by uncommenting the line below.
   * You just have to configure a context which will we redirected and the target url.
   * Example: $http.get('/users') requests will be automatically proxified.
   *
   * For more details and option, https://github.com/chimurai/http-proxy-middleware/blob/v0.9.0/README.md
   */
  // server.middleware = proxyMiddleware('/users', {target: 'http://jsonplaceholder.typicode.com', changeOrigin: true});

  browserSync.instance = browserSync.init({
    startPath: '/',
    server: server,
    browser: browser
  });
}

browserSync.use(browserSyncSpa({
  selector: '[ng-app]'// Only needed for angular apps
}));

gulp.task('serve', ['watch','seed'], function () {
  browserSyncInit([path.join(conf.paths.tmp, '/serve'), conf.paths.src]);
});

gulp.task('serve:dist', ['build'], function () {
  browserSyncInit(conf.paths.dist);
});

gulp.task('serve:e2e', ['inject','seed'], function () {
  browserSyncInit([conf.paths.tmp + '/serve', conf.paths.src], []);
});

gulp.task('serve:e2e-dist', ['build','seed:e2e-dist'], function () {
github mpalourdio / SpringBootAngularHTML5 / front / gulp / server.js View on Github external
* For more details and option, https://github.com/chimurai/http-proxy-middleware/blob/v0.0.5/README.md
     */
    server.middleware = [
        proxyMiddleware('/my-context/api', {
            target: 'http://localhost:10000'
        })
    ];

    browserSync.instance = browserSync.init({
        startPath: '/my-context/',
        server: server,
        browser: browser
    });
}

browserSync.use(browserSyncSpa({
    selector: '[ng-app]'// Only needed for angular apps
}));

gulp.task('serve', ['watch'], function () {
    browserSyncInit([path.join(conf.paths.tmp, '/serve'), conf.paths.src]);
});

gulp.task('serve:dist', ['build'], function () {
    browserSyncInit(conf.paths.dist);
});

gulp.task('serve:e2e', ['inject'], function () {
    browserSyncInit([conf.paths.tmp + '/serve', conf.paths.src], []);
});

gulp.task('serve:e2e-dist', ['build'], function () {
github Netflix / vector / gulp / server.js View on Github external
* You can add a proxy to your backend by uncommenting the line below.
   * You just have to configure a context which will we redirected and the target url.
   * Example: $http.get('/users') requests will be automatically proxified.
   *
   * For more details and option, https://github.com/chimurai/http-proxy-middleware/blob/v0.9.0/README.md
   */
  // server.middleware = proxyMiddleware('/users', {target: 'http://jsonplaceholder.typicode.com', changeOrigin: true});

  browserSync.instance = browserSync.init({
    startPath: '/',
    server: server,
    browser: browser
  });
}

browserSync.use(browserSyncSpa({
  selector: '[ng-app]'// Only needed for angular apps
}));

gulp.task('serve', ['watch'], function () {
  browserSyncInit([path.join(conf.paths.tmp, '/serve'), conf.paths.src, '.']);
});

gulp.task('serve:dist', ['build'], function () {
  browserSyncInit(conf.paths.dist);
});

gulp.task('serve:e2e', ['inject'], function () {
  browserSyncInit([conf.paths.tmp + '/serve', conf.paths.src], []);
});

gulp.task('serve:e2e-dist', ['build'], function () {
github jakubrohleder / angular-jsonapi / gulp / server.js View on Github external
* You just have to configure a context which will we redirected and the target url.
   * Example: $http.get('/users') requests will be automatically proxified.
   *
   * For more details and option, https://github.com/chimurai/http-proxy-middleware/blob/v0.0.5/README.md
   */
  // server.middleware = proxyMiddleware('/users', {target: 'http://jsonplaceholder.typicode.com', proxyHost: 'jsonplaceholder.typicode.com'});

  browserSync.instance = browserSync.init({
    startPath: '/',
    port: 5000,
    server: server,
    browser: browser
  });
}

browserSync.use(browserSyncSpa({
  selector: '[ng-app]'// Only needed for angular apps
}));

gulp.task('serve', ['watch'], function() {
  browserSyncInit([path.join(conf.paths.tmp, '/serve'), conf.paths.src]);
});

gulp.task('serve:dist', ['build:demo'], function() {
  browserSyncInit(conf.paths.dist.demo);
});

gulp.task('serve:e2e', ['inject'], function() {
  browserSyncInit([conf.paths.tmp + '/serve', conf.paths.src], []);
});

gulp.task('serve:e2e-dist', ['build:lib'], function() {
github tiberiuzuld / angular-gridster2 / gulp / server.js View on Github external
var server = {
    baseDir: baseDir,
    routes: routes
  };

  browserSync.instance = browserSync.init({
    startPath: '/',
    server: server,
    browser: 'default',
    ghostMode: false,
    notify: false
  });
}

browserSync.use(browserSyncSpa({
  selector: '[ng-app]'// Only needed for angular apps
}));

gulp.task('server', function () {
  browserSyncInit([conf.paths.serve, conf.paths.src]);
});

gulp.task('server-build', function () {
  browserSyncInit(conf.paths.dist);
});

gulp.task('serve', gulp.series('inject', 'watch', 'server'));

gulp.task('serve:dist', gulp.series('build', 'server-build'));
github Crossbow-js / crossbow-sites / gulpfile.js View on Github external
gulp.task("serve", function () {
    browserSync.use(htmlInjector);
    browserSync({
        open: false,
        logLevel: "silent",
        server: {
            baseDir: "_site",
            routes: {
                "/img": "./img",
                "/css": "test/fixtures/css"
            }
        }
    }, function (err, bs) {
        site.logger.info("View your website at: {yellow:%s}", bs.getOptionIn(["urls", "local"]));
        if (bs.getOptionIn(["urls", "external"])) {
            site.logger.info("View your website at: {yellow:%s}", bs.getOptionIn(["urls", "external"]));
        }
    });