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


TypeScript gulp.parallel函数代码示例

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


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

示例1: 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:aurelia,项目名称:aurelia,代码行数:53,代码来源:watch.ts

示例2: copyMarkup

export default function copyMarkup() {
  const tasks = [];
  for (const moduleName in project.plugin.outputs) {
    const task = `markup-${moduleName}`;
    gulp.task(task, () => {
      return gulp
        .src(path.join(root, project.plugin.src, '**/*.html'))
        .pipe(gulp.dest(path.join(project.plugin.output, moduleName)))
    })
    tasks.push(task);
  }
  return gulp.parallel(tasks);
}
开发者ID:jbockle,项目名称:aurelia-json-schema-form,代码行数:13,代码来源:copy-markup.ts

示例3: 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

示例4: readProjectConfiguration

import * as gulp from 'gulp';
import transpile from './transpile';
import processMarkup from './process-markup';
import processCSS from './process-css';
import {build} from 'aurelia-cli';
import * as project from '../aurelia.json';
import tslint from './tslint';
import copyToPhoneGap from './copy-to-phone-gap';

export default gulp.series(
  readProjectConfiguration,
  gulp.parallel(
    transpile,
    processMarkup,
    processCSS
  ),
  tslint,
  writeBundles,
  copyToPhoneGap
);

function readProjectConfiguration() {
  return build.src(project);
}

function writeBundles() {
  return build.dest();
}
开发者ID:plotter,项目名称:platform,代码行数:28,代码来源:build.ts

示例5: async

        cwd: codeExtensionSourcesPath
    });
});


gulp.task("cov:report:integration", gulp.series("cov:merge", async () => {
    return spawnNode([
        codecovPath,
        '-f',
        path.join(integrationTestCoverageRootPath, 'lcov.info'),
        '-F',
        'integration'
    ], {
        cwd: codeExtensionSourcesPath
    });
}));

gulp.task("cov:report:unit", async () => {
    return spawnNode([
        codecovPath,
        '-f',
        path.join(unitTestCoverageRootPath, 'lcov.info'),
        '-F',
        'unit'
    ], {
        cwd: codeExtensionSourcesPath
    });
});

gulp.task("cov:report", gulp.parallel("cov:report:integration", "cov:report:unit"));
开发者ID:eamodio,项目名称:omnisharp-vscode,代码行数:30,代码来源:coverageTasks.ts

示例6: onChange

function onChange(path) {
  log(`File Changed: ${path}`);
}

let karma = done => {
  new Karma({
    configFile: __dirname + '/../../karma.conf.js',
    singleRun: !CLIOptions.hasFlag('watch')
  }, done).start();
};

let unit;

if (CLIOptions.hasFlag('watch')) {
  unit = gulp.series(
    build,
    gulp.parallel(
      watch(build, onChange),
      karma
    )
  );
} else {
  unit = gulp.series(
    build,
    karma
  );
}

export default unit;
开发者ID:Resounding,项目名称:Jobs-Web,代码行数:29,代码来源:test.ts

示例7: reject

                    socket.on('error', err => console.error('WebSocket proxy error:', err)),
            },
        },
    })
    return new Promise<void>((resolve, reject) => {
        server.listen(3080, '127.0.0.1', (err?: Error) => {
            if (err) {
                reject(err)
            } else {
                resolve()
            }
        })
    })
}

/**
 * Builds everything.
 */
export const build = gulp.parallel(
    gulp.series(gulp.parallel(schema, graphQLTypes), gulp.parallel(webpack, phabricator))
)

/**
 * Watches everything and rebuilds on file changes.
 */
export const watch = gulp.series(
    // Ensure the typings that TypeScript depends on are build to avoid first-time-run errors
    gulp.parallel(schema, graphQLTypes),
    gulp.parallel(watchSchema, watchGraphQLTypes, webpackDevServer, watchPhabricator)
)
开发者ID:JoYiRis,项目名称:sourcegraph,代码行数:30,代码来源:gulpfile.ts

示例8:

import * as gulp from 'gulp';
import clean from './clean';
import buildStyles from './build-styles';
import buildJavaScript from './build-javascript';
import buildMarkup from './build-markup';

export default gulp.series(
  clean,
  gulp.parallel(
    buildJavaScript,
    buildMarkup,
    buildStyles
  )
);
开发者ID:itainteasy,项目名称:cli,代码行数:14,代码来源:build.ts

示例9: task

// tslint:disable:no-import-side-effect no-implicit-dependencies

import { parallel, series, task } from 'gulp'

import './backend'
import './dev-server'
import './pre-check'
import './proxy'

task('integration', series('preCheck', parallel('devServer', 'proxy'), 'backend'))
开发者ID:whitetrefoil,项目名称:flickr-simple-reorder,代码行数:10,代码来源:integration.ts

示例10: Karma

import {CLIOptions} from 'aurelia-cli';
import build from './build';
import watch from './watch';
import * as path from 'path';

let karma = done => {
  new Karma({
    configFile: path.join(__dirname, '/../../karma.conf.js'),
    singleRun: !CLIOptions.hasFlag('watch')
  }, done).start();
};

let unit;

if (CLIOptions.hasFlag('watch')) {
  unit = gulp.series(
    build,
    gulp.parallel(
      done => { watch(); done(); },
      karma
    )
  );
} else {
  unit = gulp.series(
    build,
    karma
  );
}

export { unit as default };
开发者ID:Jenselme,项目名称:cli,代码行数:30,代码来源:test.ts


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