當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。