NodeStuffInWebError.js 843 B

12345678910111213141516171819202122232425262728293031323334
  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. * @param {DependencyLocation} loc loc
  12. * @param {string} expression expression
  13. * @param {string} description description
  14. */
  15. constructor(loc, expression, description) {
  16. super(
  17. `${JSON.stringify(
  18. expression
  19. )} has been used, it will be undefined in next major version.
  20. ${description}`
  21. );
  22. this.name = "NodeStuffInWebError";
  23. this.loc = loc;
  24. }
  25. }
  26. makeSerializable(NodeStuffInWebError, "webpack/lib/NodeStuffInWebError");
  27. module.exports = NodeStuffInWebError;