提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
581 B

  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. const PLUGIN_NAME = "WarnNoModeSetPlugin";
  9. class WarnNoModeSetPlugin {
  10. /**
  11. * Apply the plugin
  12. * @param {Compiler} compiler the compiler instance
  13. * @returns {void}
  14. */
  15. apply(compiler) {
  16. compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
  17. compilation.warnings.push(new NoModeWarning());
  18. });
  19. }
  20. }
  21. module.exports = WarnNoModeSetPlugin;