intercept-done-to-get-dev-server-tap.js 848 B

123456789101112131415161718
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.interceptDoneToGetDevServerTap = void 0;
  4. const infrastructure_logger_1 = require("../infrastructure-logger");
  5. function interceptDoneToGetDevServerTap(compiler, config, state) {
  6. const { debug } = (0, infrastructure_logger_1.getInfrastructureLogger)(compiler);
  7. // inspired by https://github.com/ypresto/fork-ts-checker-async-overlay-webpack-plugin
  8. compiler.hooks.done.intercept({
  9. register: (tap) => {
  10. if (tap.name === 'webpack-dev-server' && tap.type === 'sync' && config.devServer) {
  11. debug('Intercepting webpack-dev-server tap.');
  12. state.webpackDevServerDoneTap = tap;
  13. }
  14. return tap;
  15. },
  16. });
  17. }
  18. exports.interceptDoneToGetDevServerTap = interceptDoneToGetDevServerTap;