tap-after-environment-to-patch-watching.js 1.1 KB

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.tapAfterEnvironmentToPatchWatching = void 0;
  4. const infrastructure_logger_1 = require("../infrastructure-logger");
  5. const inclusive_node_watch_file_system_1 = require("../watch/inclusive-node-watch-file-system");
  6. function tapAfterEnvironmentToPatchWatching(compiler, state) {
  7. const { debug } = (0, infrastructure_logger_1.getInfrastructureLogger)(compiler);
  8. compiler.hooks.afterEnvironment.tap('ForkTsCheckerWebpackPlugin', () => {
  9. const watchFileSystem = compiler.watchFileSystem;
  10. if (watchFileSystem) {
  11. debug("Overwriting webpack's watch file system.");
  12. // wrap original watch file system
  13. compiler.watchFileSystem = new inclusive_node_watch_file_system_1.InclusiveNodeWatchFileSystem(
  14. // we use some internals here
  15. watchFileSystem, compiler, state);
  16. }
  17. else {
  18. debug('No watch file system found - plugin may not work correctly.');
  19. }
  20. });
  21. }
  22. exports.tapAfterEnvironmentToPatchWatching = tapAfterEnvironmentToPatchWatching;