NodeStuffInWebError.js 939 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. /** @import { DependencyLocation } from "../Dependency" */
  7. const makeSerializable = require("../util/makeSerializable");
  8. const WebpackError = require("./WebpackError");
  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. /** @type {DependencyLocation} */
  26. this.loc = loc;
  27. }
  28. }
  29. makeSerializable(NodeStuffInWebError, "webpack/lib/errors/NodeStuffInWebError");
  30. module.exports = NodeStuffInWebError;