UnusedAliasesWarning.js 1.0 KB

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 UnusedAliasesWarning extends WebpackError {
  8. /**
  9. * Creates an instance of UnusedAliasesWarning.
  10. * @param {string[]} names the alias names no request matched
  11. */
  12. constructor(names) {
  13. super(
  14. `webpack alias recommendations: \nThe following 'resolve.alias' ${
  15. names.length === 1 ? "entry was" : "entries were"
  16. } never applied to a request: ${names.join(
  17. ", "
  18. )}.\nAn alias nothing matches is usually a typo in the name, or a leftover from a package that is now imported directly. Note that an alias is matched against the request as written, so renaming the request without renaming the alias leaves the alias dead and the original request resolved as-is.\nFor more info visit https://webpack.js.org/configuration/resolve/#resolvealias`
  19. );
  20. /** @type {string} */
  21. this.name = "UnusedAliasesWarning";
  22. }
  23. }
  24. module.exports = UnusedAliasesWarning;