ForkTsCheckerWarningWebpackPlugin.js 823 B

12345678910111213141516171819202122232425
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. 'use strict';
  8. // References:
  9. // - https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#plugin-hooks
  10. // - https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/232#issuecomment-645543747
  11. const ForkTsCheckerWebpackPlugin = require('./ForkTsCheckerWebpackPlugin');
  12. module.exports = class ForkTsCheckerWarningWebpackPlugin {
  13. apply(compiler) {
  14. new ForkTsCheckerWebpackPlugin().apply(compiler);
  15. const hooks = ForkTsCheckerWebpackPlugin.getCompilerHooks(compiler);
  16. hooks.issues.tap('ForkTsCheckerWarningWebpackPlugin', issues =>
  17. issues.map(issue => ({ ...issue, severity: 'warning' }))
  18. );
  19. }
  20. };