source: frontend/node_modules/fork-ts-checker-webpack-plugin/lib/hooks/pluginHooks.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.8 KB
RevLine 
[9af201e]1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const tapable_1 = require("tapable");
4const compilerHookMap = new WeakMap();
5function createForkTsCheckerWebpackPluginHooks() {
6 return {
7 start: new tapable_1.AsyncSeriesWaterfallHook([
8 'change',
9 'compilation',
10 ]),
11 waiting: new tapable_1.SyncHook(['compilation']),
12 canceled: new tapable_1.SyncHook(['compilation']),
13 error: new tapable_1.SyncHook(['error', 'compilation']),
14 issues: new tapable_1.SyncWaterfallHook([
15 'issues',
16 'compilation',
17 ]),
18 };
19}
20function forwardForkTsCheckerWebpackPluginHooks(source, target) {
21 source.start.tapPromise('ForkTsCheckerWebpackPlugin', target.start.promise);
22 source.waiting.tap('ForkTsCheckerWebpackPlugin', target.waiting.call);
23 source.canceled.tap('ForkTsCheckerWebpackPlugin', target.canceled.call);
24 source.error.tap('ForkTsCheckerWebpackPlugin', target.error.call);
25 source.issues.tap('ForkTsCheckerWebpackPlugin', target.issues.call);
26}
27function getForkTsCheckerWebpackPluginHooks(compiler) {
28 let hooks = compilerHookMap.get(compiler);
29 if (hooks === undefined) {
30 hooks = createForkTsCheckerWebpackPluginHooks();
31 compilerHookMap.set(compiler, hooks);
32 // proxy hooks for multi-compiler
33 if ('compilers' in compiler) {
34 compiler.compilers.forEach((childCompiler) => {
35 const childHooks = getForkTsCheckerWebpackPluginHooks(childCompiler);
36 if (hooks) {
37 forwardForkTsCheckerWebpackPluginHooks(childHooks, hooks);
38 }
39 });
40 }
41 }
42 return hooks;
43}
44exports.getForkTsCheckerWebpackPluginHooks = getForkTsCheckerWebpackPluginHooks;
Note: See TracBrowser for help on using the repository browser.