当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript browser-sync.default函数代码示例

本文整理汇总了TypeScript中browser-sync.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了default函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: startLocalhost

function startLocalhost() {
  return browserSync(null, {
    server: {
      baseDir: ['tmp/serve']
    }
  })
}
开发者ID:intraspacedesign,项目名称:intraspacedesign.net,代码行数:7,代码来源:tasks.ts

示例2: browserSync

gulp.task('serve:prod', ['build:prod'], () => {
    // Proxy to localhost:8080
    var proxyOptions = url.parse('http://localhost:8080/api');
    proxyOptions.route = '/api';
    proxyOptions.preserveHost = true;

    browserSync({
        logPrefix: 'VASS Angular2 Test',
        port: 5000,
        browser: 'google chrome',
        server: {
            baseDir: './dist',
            middleware: [function (req, res, next) {
                // CORS Origin....
                    res.setHeader('Access-Control-Allow-Origin', '*');
                    next();
                }, proxy(proxyOptions)]
        }
    });

    // Watch for changes on build folder. A change on src folder will make watch task run.
    // This task will put the files on build folder.
    // So, we ahve to watch on build folder to reload the browser 
    gulp.watch([
        "/build/**/*.js",
        "/build/**/*.css",
        "/build/**/*.html"
    ], browserSync.reload);
});
开发者ID:nestis,项目名称:widgetFrontAngular2,代码行数:29,代码来源:gulpfile.ts

示例3: function

gulp.task('serve', function () {
    browserSync({
        server: {
            baseDir: 'build',
            routes: {
                '/node_modules': 'node_modules'
            }
        }
    }, function (err, bs) {
        console.log(bs.options.getIn(['urls', 'local']));
    });

    gulp.run('watch');
    gulp.watch('private/*.scss', ['scss']);
    gulp.watch(['build/**/*.html', 'build/**/*.js']).on('change', browserSync.reload);
});
开发者ID:Flight,项目名称:jabra,代码行数:16,代码来源:gulpfile.ts

示例4: superstatic

gulp.task('dev', () => {
	browserSync({
	    port: 3002,
	    file: ['index.html', '**/*.js', '**/*.ts', '**/*.html', '**/*.less'],
	    injectChange: true,
	    logFileChange: false,
	    logLevel: 'silent',
	    notify: true,
	    reloadDelay: 0,
	    server: {
		    baseDir: './',
		    middleware: superstatic({debug: false})
	    }
  	});
  	// gulp.watch(['app/**/*.less', 'app/**/*.html', 'app/**/*.ts', 'app/**/*.js', 'index.html'], ['reload']);
});
开发者ID:destyjustc,项目名称:agl2-research,代码行数:16,代码来源:gulpfile.ts

示例5: startBrowserSync

function startBrowserSync(isDev: boolean, isSpecRunner: boolean): void{
    'use strict';
     var tunnel = null;
    var online = false;
     if (args.nosync || browserSync.active) {
        return;
    };
    if (args.online) {
        tunnel = config.subdomain;
        online = true;
    }
    console.log('Starting browser-sync on port ' + port);
    if (isDev) {
        gulp.watch([config.less, config.sourceTs, config.sourceHtmls], ['serve-dev', browserSync.reload])
            .on('change', changeEvent);
         gulp.watch([config.sourceSpecs], ['compile-specs', browserSync.reload])
            .on('change', changeEvent);
    } else {
         gulp.watch([config.less, config.sourceTs, config.sourceHtmls], ['optimize', browserSync.reload])
            .on('change', changeEvent);
         gulp.watch([config.sourceSpecs], ['compile-specs', browserSync.reload])
            .on('change', changeEvent);
    }
    var options = {
        proxy: 'localhost:' + port,
        port: 3000,
        files: isDev ? [
            config.build + '**/*.*',
            config.temp + '**/*.css'
        ] : [],
        ghostMode: true,
        injectChanges: true,
        logFileChanges: true,
        logLevel: 'debug',
        logPrefix: 'Acklen Avenue',
        notify: true,
        reloadDelay: 5000,
        startPath: null,
        tunnel: tunnel,
        online: online
    };
    if (isSpecRunner) {
        options.startPath = config.specRunnerFile;
    }
     browserSync(options);

}
开发者ID:dcaballeroc,项目名称:unicron,代码行数:47,代码来源:gulpfileTypescript.ts

示例6: browsersync

export = gulp.task('serve', () => {
  browsersync(config.browsersync);
});
开发者ID:mogusbi,项目名称:ts-starter,代码行数:3,代码来源:serve.ts

示例7: browserSync

export const create = (opts: IOptions) => browserSync(createBrowserSyncOptions(opts));
开发者ID:morlay,项目名称:webpack-browser-sync,代码行数:1,代码来源:index.ts


注:本文中的browser-sync.default函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。