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


TypeScript gulp-connect.reload函数代码示例

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


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

示例1:

gulp.task('html', () => {
  gulp.src('./app/*.html')
    .pipe(connect.reload());
});
开发者ID:AlexGalays,项目名称:DefinitelyTyped,代码行数:4,代码来源:gulp-connect-tests.ts

示例2: task

task('e2e.build', function () {
  var indexTemplate = template(
    readFileSync(`${SCRIPTS_ROOT}/${E2E_NAME}/e2e.template.dev.html`).toString()
  )({
    buildConfig: buildConfig
  });

  // Get each test folder with src
  var tsResult = src([
    'src/components/*/test/*/**/*.ts',
    '!src/components/*/test/*/**/*.spec.ts'
  ])
    .pipe(cache('e2e.ts'))
    .pipe(tsc(getTscOptions(), undefined, tscReporter))
    .on('error', function (error) {
      console.log(error.message);
    })
    .pipe(gulpif(/app-module.js$/, createIndexHTML()))
    .pipe(gulpif(/e2e.js$/, createPlatformTests()));

  var testFiles = src([
    'src/components/*/test/*/**/*',
    '!src/components/*/test/*/**/*.ts'
  ])
    .pipe(cache('e2e.files'));

  return merge([
    tsResult,
    testFiles
  ])
    .pipe(rename(function (file) {
      file.dirname = file.dirname.replace(sep + 'test' + sep, sep);
    }))
    .pipe(dest(DIST_E2E_ROOT))
    .pipe(connect.reload());

  function createIndexHTML() {
    return obj(function (file, enc, next) {
      this.push(new VinylFile({
        base: file.base,
        contents: new Buffer(indexTemplate),
        path: join(dirname(file.path), 'index.html'),
      }));
      next(null, file);
    });
  }

  function createPlatformTests() {
    let platforms = [
      'android',
      'ios',
      'windows'
    ];

    let testTemplate = template(readFileSync(`${SCRIPTS_ROOT}/${E2E_NAME}/e2e.template.js`).toString());

    return obj(function (file, enc, next) {
      let self = this;

      let relativePath = dirname(file.path.replace(/^.*?src(\/|\\)components(\/|\\)/, ''));
      relativePath = relativePath.replace('/test/', '/');

      let contents = file.contents.toString();
      platforms.forEach(function (platform) {
        let platformContents = testTemplate({
          contents: contents,
          buildConfig: buildConfig,
          relativePath: relativePath,
          platform: platform
        });
        self.push(new VinylFile({
          base: file.base,
          contents: new Buffer(platformContents),
          path: file.path.replace(/e2e.js$/, platform + '.e2e.js')
        }));
      });
      next();
    });
  }
});
开发者ID:JackMj,项目名称:ionic,代码行数:80,代码来源:e2e.dev.ts

示例3: compileTypeScript

gulp.task("typescript:dev", () => {
    return compileTypeScript(devProject)
        .pipe(gulp.dest(Paths.TypeScriptDist))
        .pipe(connect.reload());
});
开发者ID:lukeautry,项目名称:typescript-bundler,代码行数:5,代码来源:typescript.ts

示例4: streamqueue

gulp.task("typescript:prod", ["create-empty-js"], () => {
    return streamqueue({ objectMode: true }, getModuleLoader(), getProdSystemConfig(), getTypeScriptBundle(), getSystemImport())
        .pipe(concat(bundleFileName))
        .pipe(gulp.dest(Paths.ScriptsDist))
        .pipe(connect.reload());
});
开发者ID:lukeautry,项目名称:typescript-bundler,代码行数:6,代码来源:typescript.ts

示例5: triggerLivereload

export function triggerLivereload() {
  console.log(chalk.yellow('Server: Changes were detected and a livereload was triggered.'));
  return src('dist').pipe(gulpConnect.reload());
}
开发者ID:gnucoop,项目名称:material2-extra,代码行数:4,代码来源:trigger-livereload.ts

示例6:

gulp.task('stylus', () => {
  gulp.src('./app/stylus/*.styl')
    // .pipe(stylus()) // just here for demonstration purposes
    .pipe(gulp.dest('./app/css'))
    .pipe(connect.reload());
});
开发者ID:Silver-Connection,项目名称:DefinitelyTyped,代码行数:6,代码来源:gulp-connect-tests.ts


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