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


TypeScript gulp.series函数代码示例

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


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

示例1: watchJekyll

function watchJekyll(neverDone) {
  return watch([
    'src/**/*.{csv,html,md,yml}'
  ],
  series(buildJekyll, function reloadBrowsers(done) {
    browserSync.reload()
    done()
  }))
}
开发者ID:intraspacedesign,项目名称:intraspacedesign.net,代码行数:9,代码来源:jekyllrb.ts

示例2: done

gulp.task('clean.once', (done: any) => {
  if (firstRun) {
    firstRun = false;
    gulp.series([ 'clean.dev' ])(done);
  } else {
    util.log('Skipping clean on rebuild');
    done();
  }
});
开发者ID:our-city-app,项目名称:gae-plugin-framework,代码行数:9,代码来源:gulpfile.ts

示例3: watch

function watch(){
  return gulp.watch([
    `${paths.src}/**/*`,
    `index.html`,
    `systemjs.config.js`,
    `styles.css`,
    `!${paths.src}/**/*.spec.ts`
  ], gulp.series('build:dev'));
}
开发者ID:IsomorphicPlanningPoker,项目名称:planning-poker-ng2,代码行数:9,代码来源:gulpfile.ts

示例4: debounce

let refresh = debounce(() => {
  if (isBuilding) {
    log('Watcher: A build is already in progress, deferring change detection...');
    return;
  }

  isBuilding = true;

  let paths = pendingRefreshPaths.splice(0);
  let refreshTasks = [];

  // determine which tasks need to be executed
  // based on the files that have changed
  for (let watcher of watches) {    
    if (Array.isArray(watcher.source)) {
      for(let source of watcher.source) {
        if (paths.find(path => minimatch(path, source))) {
          refreshTasks.push(watcher);
        }
      }
    }
    else {
      if (paths.find(path => minimatch(path, watcher.source))) {
        refreshTasks.push(watcher);
      }
    }
  }

  if (refreshTasks.length === 0) {
    log('Watcher: No relevant changes found, skipping next build.');
    isBuilding = false;
    return;
  }

  log(`Watcher: Running ${refreshTasks.map(x => x.name).join(', ')} tasks on next build...`);

  let toExecute = gulp.series(
    readProjectConfiguration,
    gulp.parallel(refreshTasks.map(x => x.callback)),
    writeBundles,
    (done) => {
      isBuilding = false;
      watchCallback();
      done();
      if (pendingRefreshPaths.length > 0) {
        log('Watcher: Found more pending changes after finishing build, triggering next one...');
        refresh();
      }
    }
  );

  toExecute();
}, debounceWaitTime);
开发者ID:Resounding,项目名称:Jobs-Web,代码行数:53,代码来源:watch.ts

示例5: compileAndWatch

export function compileAndWatch(options) {
  const tsProject = options.tsProject || createTsProjectFromOptions(options);

  const boundCompile = compile.bind(Object.assign(options, {
    tsProject
  }));

  return series(boundCompile, () => {
    watch(getCompilePaths(options.compilePaths), {interval: 1000, usePolling: true}, boundCompile)
      .on('change', () => {
        log('=== Source change detected. Recompiling...');
      });
  })();
}
开发者ID:netanelgilad,项目名称:bigg-typescript,代码行数:14,代码来源:compileAndWatch.ts

示例6: compileAndBundle

export function compileAndBundle(options) {
  let startTime = new Date();
  return promisify(series(
    compile.bind(undefined, options.compile || {}),
    bundle.bind(undefined, options.bundle || {}),
    (done) => {
      const completionTime = Math.round((new Date().getTime() - startTime.getTime()) / 1000 * 100) / 100;

      log('------------------------------------------');
      log(`=== Compilation and bundling completed in ${completionTime} sec.`);
      log('------------------------------------------');
      done();
    }
  ));
}
开发者ID:botique-ai,项目名称:bigg-botique,代码行数:15,代码来源:compileAndBundle.ts

示例7: debounce

let refresh = debounce(() => {
  if (isBuilding) {
    log('Watcher: A build is already in progress, deferring change detection...');
    return;
  }

  isBuilding = true;

  let paths = pendingRefreshPaths.splice(0);
  let refreshTasks = [];

  // Dynamically compose tasks
  for (let src of Object.keys(watches)) {
    if (paths.find((x) => minimatch(x, src))) {
      log(`Watcher: Adding ${watches[src].name} task to next build...`);
      refreshTasks.push(watches[src].callback);
    }
  }

  if (refreshTasks.length === 0) {
    log('Watcher: No relevant changes found, skipping next build.');
    isBuilding = false;
    return;
  }

  let toExecute = gulp.series(
    readProjectConfiguration,
    gulp.parallel(refreshTasks),
    writeBundles,
    (done) => {
      isBuilding = false;
      watchCallback();
      done();
      if (pendingRefreshPaths.length > 0) {
        log('Watcher: Found more pending changes after finishing build, triggering next one...');
        refresh();
      }
    }
  );

  toExecute();
}, debounceWaitTime);
开发者ID:reyno-uk,项目名称:cli,代码行数:42,代码来源:watch.ts

示例8: getLanguages

gulp.task('build-frontend', (() => {
  const languages = getLanguages().filter((l) => {
    return l !== 'en';
  });
  const tasks = [];
  createFrontendTask('build-frontend-release default',
    'ng build --aot --prod --output-path=./release/dist --no-progress --i18n-locale=en' +
    ' --i18n-format xlf --i18n-file frontend/' + translationFolder + '/messages.en.xlf' +
    ' --i18n-missing-translation warning');
  tasks.push('build-frontend-release default');
  for (let i = 0; i < languages.length; i++) {
    createFrontendTask('build-frontend-release ' + languages[i],
      'ng build --aot --prod --output-path=./release/dist/' + languages[i] +
      ' --no-progress --i18n-locale=' + languages[i] +
      ' --i18n-format xlf --i18n-file frontend/' + translationFolder + '/messages.' + languages[i] + '.xlf' +
      ' --i18n-missing-translation warning');
    tasks.push('build-frontend-release ' + languages[i]);
  }
  return gulp.series(...tasks);
})());
开发者ID:bpatrik,项目名称:PiGallery2,代码行数:20,代码来源:gulpfile.ts

示例9: compileBundleAndWatch

export function compileBundleAndWatch(options) {
  options = Object.assign({
    compile: {},
    bundle: {}
  }, options);

  const boundCompileAndBundle = () => {
    return compileAndBundle(options)
      .then(() => log('==== Watching for changes... ===='));
  };

  return promisify(series(
    boundCompileAndBundle,
    () => {
      return watch(getCompilePaths(options.compile.compilePaths), {
        interval: 1000,
        usePolling: true
      }, boundCompileAndBundle)
        .on('change', () => {
          log('=== Source change detected. Recompiling...');
        });
    }));
}
开发者ID:botique-ai,项目名称:bigg-botique,代码行数:23,代码来源:compileBundleAndWatch.ts


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