hooks.js 1.2 KB

123456789101112131415161718192021222324252627
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var tapable_1 = require("tapable");
  4. var compilerHookMap = new WeakMap();
  5. function createForkTsCheckerWebpackPluginHooks() {
  6. return {
  7. serviceBeforeStart: new tapable_1.AsyncSeriesHook([]),
  8. cancel: new tapable_1.SyncHook(['cancellationToken']),
  9. serviceStartError: new tapable_1.SyncHook(['error']),
  10. waiting: new tapable_1.SyncHook([]),
  11. serviceStart: new tapable_1.SyncHook(['tsconfigPath', 'memoryLimit']),
  12. receive: new tapable_1.SyncHook(['diagnostics', 'lints']),
  13. serviceOutOfMemory: new tapable_1.SyncHook([]),
  14. emit: new tapable_1.SyncHook(['diagnostics', 'lints', 'elapsed']),
  15. done: new tapable_1.SyncHook(['diagnostics', 'lints', 'elapsed'])
  16. };
  17. }
  18. function getForkTsCheckerWebpackPluginHooks(compiler) {
  19. var hooks = compilerHookMap.get(compiler);
  20. if (hooks === undefined) {
  21. hooks = createForkTsCheckerWebpackPluginHooks();
  22. compilerHookMap.set(compiler, hooks);
  23. }
  24. return hooks;
  25. }
  26. exports.getForkTsCheckerWebpackPluginHooks = getForkTsCheckerWebpackPluginHooks;
  27. //# sourceMappingURL=hooks.js.map