UNPKG

833 BJavaScriptView Raw
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Ivan Kopeykin @vankop
4*/
5
6"use strict";
7
8const WebpackError = require("./WebpackError");
9const makeSerializable = require("./util/makeSerializable");
10
11class UnhandledSchemeError extends WebpackError {
12 /**
13 * @param {string} scheme scheme
14 * @param {string} resource resource
15 */
16 constructor(scheme, resource) {
17 super(
18 `Reading from "${resource}" is not handled by plugins (Unhandled scheme).` +
19 '\nWebpack supports "data:" and "file:" URIs by default.' +
20 `\nYou may need an additional plugin to handle "${scheme}:" URIs.`
21 );
22 this.file = resource;
23 this.name = "UnhandledSchemeError";
24 }
25}
26
27makeSerializable(
28 UnhandledSchemeError,
29 "webpack/lib/UnhandledSchemeError",
30 "UnhandledSchemeError"
31);
32
33module.exports = UnhandledSchemeError;