• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript gulp.series函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript gulp.src函数代码示例发布时间:2022-05-25
下一篇:
TypeScript gulp.parallel函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap