NodeStuffInWebError.js 915 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Ivan Kopeykin @vankop
  4. */
  5. "use strict";
  6. const WebpackError = require("./WebpackError");
  7. const makeSerializable = require("./util/makeSerializable");
  8. /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
  9. class NodeStuffInWebError extends WebpackError {
  10. /**
  11. * Creates an instance of NodeStuffInWebError.
  12. * @param {DependencyLocation} loc loc
  13. * @param {string} expression expression
  14. * @param {string} description description
  15. */
  16. constructor(loc, expression, description) {
  17. super(
  18. `${JSON.stringify(
  19. expression
  20. )} has been used, it will be undefined in next major version.
  21. ${description}`
  22. );
  23. /** @type {string} */
  24. this.name = "NodeStuffInWebError";
  25. this.loc = loc;
  26. }
  27. }
  28. makeSerializable(NodeStuffInWebError, "webpack/lib/NodeStuffInWebError");
  29. module.exports = NodeStuffInWebError;