UnhandledSchemeError.js 833 B

123456789101112131415161718192021222324252627282930313233
  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. class UnhandledSchemeError extends WebpackError {
  9. /**
  10. * @param {string} scheme scheme
  11. * @param {string} resource resource
  12. */
  13. constructor(scheme, resource) {
  14. super(
  15. `Reading from "${resource}" is not handled by plugins (Unhandled scheme).` +
  16. '\nWebpack supports "data:" and "file:" URIs by default.' +
  17. `\nYou may need an additional plugin to handle "${scheme}:" URIs.`
  18. );
  19. this.file = resource;
  20. this.name = "UnhandledSchemeError";
  21. }
  22. }
  23. makeSerializable(
  24. UnhandledSchemeError,
  25. "webpack/lib/UnhandledSchemeError",
  26. "UnhandledSchemeError"
  27. );
  28. module.exports = UnhandledSchemeError;