UnusedRuleWarning.js 966 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Alexander Akait @alexander-akait
  4. */
  5. "use strict";
  6. const WebpackError = require("./WebpackError");
  7. class UnusedRuleWarning extends WebpackError {
  8. /**
  9. * Creates an instance of UnusedRuleWarning.
  10. * @param {string[]} rules descriptions of the rules that never matched
  11. */
  12. constructor(rules) {
  13. super(
  14. `webpack rule recommendations: \nThe following ${
  15. rules.length === 1 ? "rule was" : "rules were"
  16. } never applied to a module: ${rules.join(
  17. ", "
  18. )}.\nA rule that matches nothing is usually a typo in 'test', 'include' or 'exclude', or a leftover from a removed file type. Plugins add rules as well, so a rule listed here may come from a plugin rather than from your configuration.\nFor more info visit https://webpack.js.org/configuration/module/#modulerules`
  19. );
  20. /** @type {string} */
  21. this.name = "UnusedRuleWarning";
  22. }
  23. }
  24. module.exports = UnusedRuleWarning;