WarnNoModeSetPlugin.js 545 B

12345678910111213141516171819202122232425
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const NoModeWarning = require("./NoModeWarning");
  7. /** @typedef {import("./Compiler")} Compiler */
  8. class WarnNoModeSetPlugin {
  9. /**
  10. * Apply the plugin
  11. * @param {Compiler} compiler the compiler instance
  12. * @returns {void}
  13. */
  14. apply(compiler) {
  15. compiler.hooks.thisCompilation.tap("WarnNoModeSetPlugin", compilation => {
  16. compilation.warnings.push(new NoModeWarning());
  17. });
  18. }
  19. }
  20. module.exports = WarnNoModeSetPlugin;