How to use the tapable.AsyncParallelHook function in tapable

To help you get started, we’ve selected a few tapable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wxajs / wxa / packages / wxa-cli / src / builder.js View on Github external
}

        // chokidar options.
        this.isWatching = false;
        this.isWatchReady = false;

        this.appJSON = path.join(this.wxaConfigs.context, 'app.json');
        this.wxaJSON = path.join(this.wxaConfigs.context, 'app'+this.wxaConfigs.resolve.ext);

        this.progress = new ProgressTextBar(this.current, this.wxaConfigs);

        this.hooks = {
            entryOption: new SyncBailHook(['entry']),
            beforeRun: new AsyncSeriesHook(['compiler']),
            run: new AsyncSeriesHook(['compiler']),
            done: new AsyncParallelHook(['compilation']),
            rebuildModule: new AsyncSeriesHook(['changedModule']),
            finishRebuildModule: new AsyncParallelHook(['compilation', 'changedModule']),
        };
    }
github wxajs / wxa / packages / wxa-cli / src / builder.js View on Github external
// chokidar options.
        this.isWatching = false;
        this.isWatchReady = false;

        this.appJSON = path.join(this.wxaConfigs.context, 'app.json');
        this.wxaJSON = path.join(this.wxaConfigs.context, 'app'+this.wxaConfigs.resolve.ext);

        this.progress = new ProgressTextBar(this.current, this.wxaConfigs);

        this.hooks = {
            entryOption: new SyncBailHook(['entry']),
            beforeRun: new AsyncSeriesHook(['compiler']),
            run: new AsyncSeriesHook(['compiler']),
            done: new AsyncParallelHook(['compilation']),
            rebuildModule: new AsyncSeriesHook(['changedModule']),
            finishRebuildModule: new AsyncParallelHook(['compilation', 'changedModule']),
        };
    }
github antvis / L7 / packages / core / src / services / scene / SceneService.ts View on Github external
public constructor() {
    super();
    // @see https://github.com/webpack/tapable#usage
    this.hooks = {
      /**
       * 初始化异步任务,可并行:
       * 1. initMap:初始化地图底图、相机
       * 2. initRenderer:初始化渲染引擎
       * 3. initWorker:初始化 Worker
       */
      init: new AsyncParallelHook(['config']),
    };
  }
github flaviuse / mern-authentication / client / node_modules / webpack / lib / Compiler.js View on Github external
/** @type {SyncHook} */
			thisCompilation: new SyncHook(["compilation", "params"]),
			/** @type {SyncHook} */
			compilation: new SyncHook(["compilation", "params"]),
			/** @type {SyncHook} */
			normalModuleFactory: new SyncHook(["normalModuleFactory"]),
			/** @type {SyncHook}  */
			contextModuleFactory: new SyncHook(["contextModulefactory"]),

			/** @type {AsyncSeriesHook} */
			beforeCompile: new AsyncSeriesHook(["params"]),
			/** @type {SyncHook} */
			compile: new SyncHook(["params"]),
			/** @type {AsyncParallelHook} */
			make: new AsyncParallelHook(["compilation"]),
			/** @type {AsyncSeriesHook} */
			afterCompile: new AsyncSeriesHook(["compilation"]),

			/** @type {AsyncSeriesHook} */
			watchRun: new AsyncSeriesHook(["compiler"]),
			/** @type {SyncHook} */
			failed: new SyncHook(["error"]),
			/** @type {SyncHook} */
			invalid: new SyncHook(["filename", "changeTime"]),
			/** @type {SyncHook} */
			watchClose: new SyncHook([]),

			// TODO the following hooks are weirdly located here
			// TODO move them for webpack 5
			/** @type {SyncHook} */
			environment: new SyncHook([]),
github jake-101 / bael-template / node_modules / webpack / lib / Compiler.js View on Github external
/** @type {SyncHook} */
			thisCompilation: new SyncHook(["compilation", "params"]),
			/** @type {SyncHook} */
			compilation: new SyncHook(["compilation", "params"]),
			/** @type {SyncHook} */
			normalModuleFactory: new SyncHook(["normalModuleFactory"]),
			/** @type {SyncHook}  */
			contextModuleFactory: new SyncHook(["contextModulefactory"]),

			/** @type {AsyncSeriesHook} */
			beforeCompile: new AsyncSeriesHook(["params"]),
			/** @type {SyncHook} */
			compile: new SyncHook(["params"]),
			/** @type {AsyncParallelHook} */
			make: new AsyncParallelHook(["compilation"]),
			/** @type {AsyncSeriesHook} */
			afterCompile: new AsyncSeriesHook(["compilation"]),

			/** @type {AsyncSeriesHook} */
			watchRun: new AsyncSeriesHook(["compiler"]),
			/** @type {SyncHook} */
			failed: new SyncHook(["error"]),
			/** @type {SyncHook} */
			invalid: new SyncHook(["filename", "changeTime"]),
			/** @type {SyncHook} */
			watchClose: new SyncHook([]),

			// TODO the following hooks are weirdly located here
			// TODO move them for webpack 5
			/** @type {SyncHook} */
			environment: new SyncHook([]),
github caviarjs / caviar / src / block / index.js View on Github external
const DEFAULT_HOOKS = () => ({
  // TODO: hooks paramaters
  // beforeBuild: new SyncHook(),
  // built: new SyncHook(),
  created: new SyncHook(['outlet', 'caviarOptions']),
  beforeRun: new AsyncParallelHook(['caviarOptions']),
  run: new AsyncParallelHook(['returnValue', 'caviarOptions']),
  config: new SyncHook(['config', 'caviarOptions'])
})
github 101arrowz / pwa-manifest / packages / webpack-plugin-pwa-manifest / index.ts View on Github external
const createHooks = (): Hooks => ({
  start: new AsyncParallelHook(),
  defaultIconsStart: new AsyncParallelHook(['msg']),
  defaultIconsGen: new SyncHook(['data']),
  defaultIconsEnd: new AsyncParallelHook(),
  appleTouchIconStart: new AsyncParallelHook(['msg']),
  appleTouchIconGen: new SyncHook(['data']),
  appleTouchIconEnd: new AsyncParallelHook(),
  faviconStart: new AsyncParallelHook(['msg']),
  faviconGen: new SyncHook(['data']),
  faviconEnd: new AsyncParallelHook(),
  msTileStart: new AsyncParallelHook(['msg']),
  msTileGen: new SyncHook(['data']),
  msTileEnd: new AsyncParallelHook(),
  end: new AsyncParallelHook()
});
class WebpackPluginPWAManifest {
github intuit / auto / packages / core / src / utils / make-hooks.ts View on Github external
modifyConfig: new SyncWaterfallHook(['config']),
  beforeShipIt: new SyncHook(),
  afterAddToChangelog: new AsyncSeriesHook(['context']),
  beforeCommitChangelog: new AsyncSeriesHook(['context']),
  afterShipIt: new AsyncParallelHook(['version', 'commits', 'context']),
  afterRelease: new AsyncParallelHook(['releaseInfo']),
  onCreateRelease: new SyncHook(['options']),
  onCreateChangelog: new SyncHook(['changelog', 'version']),
  onCreateLogParse: new SyncHook(['logParse']),
  getAuthor: new AsyncSeriesBailHook(),
  getPreviousVersion: new AsyncSeriesBailHook(),
  getRepository: new AsyncSeriesBailHook(),
  version: new AsyncParallelHook(['version']),
  afterVersion: new AsyncParallelHook(),
  publish: new AsyncParallelHook(['version']),
  afterPublish: new AsyncParallelHook(),
  canary: new AsyncSeriesBailHook(['canaryVersion', 'postFix']),
  next: new AsyncSeriesWaterfallHook(['preReleaseVersions', 'bump'])
});
github neo-one-suite / neo-one / packages / neo-one-client / src / ClientBase.ts View on Github external
public constructor(providersIn: TUserAccountProviders) {
    this.hooks = {
      beforeRelay: new AsyncParallelHook(['beforeRelay']),
      relayError: new AsyncParallelHook(['error']),
      afterRelay: new AsyncParallelHook(['transaction']),
      beforeConfirmed: new AsyncParallelHook(['transaction']),
      confirmedError: new AsyncParallelHook(['transaction', 'error']),
      afterConfirmed: new AsyncParallelHook(['transaction', 'receipt']),
      afterCall: new AsyncParallelHook(['receipt']),
      callError: new AsyncParallelHook(['error']),
    };
    const providersArray = Object.values(providersIn);
    const providerIn =
      providersArray.find((provider) => provider.getCurrentAccount() !== undefined) ||
      (providersArray[0] as UserAccountProvider | undefined);
    if (providerIn === undefined) {
      throw new Error('At least one provider is required');
    }

    if (Object.entries(providersIn).some(([type, provider]) => type !== provider.type)) {
      throw new Error('Provider keys must be named the same as their type');
github 101arrowz / pwa-manifest / packages / webpack-plugin-pwa-manifest / index.ts View on Github external
const createHooks = (): Hooks => ({
  start: new AsyncParallelHook(),
  defaultIconsStart: new AsyncParallelHook(['msg']),
  defaultIconsGen: new SyncHook(['data']),
  defaultIconsEnd: new AsyncParallelHook(),
  appleTouchIconStart: new AsyncParallelHook(['msg']),
  appleTouchIconGen: new SyncHook(['data']),
  appleTouchIconEnd: new AsyncParallelHook(),
  faviconStart: new AsyncParallelHook(['msg']),
  faviconGen: new SyncHook(['data']),
  faviconEnd: new AsyncParallelHook(),
  msTileStart: new AsyncParallelHook(['msg']),
  msTileGen: new SyncHook(['data']),
  msTileEnd: new AsyncParallelHook(),
  end: new AsyncParallelHook()
});
class WebpackPluginPWAManifest {