How to use the tapable.AsyncWaterfallHook 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 mzgoddard / hard-source-webpack-plugin / lib / util / plugin-compat.js View on Github external
exports.register = (tapable, name, style, args) => {
  if (tapable.hooks) {
    if (!hookTypes) {
      const Tapable = require('tapable');
      hookTypes = {
        sync: Tapable.SyncHook,
        syncWaterfall: Tapable.SyncWaterfallHook,
        syncBail: Tapable.SyncBailHook,
        asyncWaterfall: Tapable.AsyncWaterfallHook,
        asyncParallel: Tapable.AsyncParallelHook,
        asyncSerial: Tapable.AsyncSeriesHook,
        asyncSeries: Tapable.AsyncSeriesHook,
      };
    }
    if (!tapable.hooks[name]) {
      tapable.hooks[name] = new hookTypes[style](args);
    }
  } else {
    if (!tapable.__hardSource_hooks) {
      tapable.__hardSource_hooks = {};
    }
    if (!tapable.__hardSource_hooks[name]) {
      tapable.__hardSource_hooks[name] = {
        name,
        dashName: camelToDash(name),