UNPKG

686 BJavaScriptView Raw
1var loaderUtils = require("loader-utils");
2
3/**
4 * @see https://webpack.github.io/docs/loaders.html
5 */
6module.exports = function() {}
7
8/**
9 * @see https://webpack.github.io/docs/loaders.html#pitching-loader
10 */
11module.exports.pitch = function(remainingRequest) {
12 if (this.cacheable) {
13 this.cacheable();
14 }
15
16 return `
17 var result = require(${loaderUtils.stringifyRequest(this, "!!" + remainingRequest)});
18
19 if (result && result.__esModule) {
20 result = result.default;
21 }
22
23 if (typeof result === "string") {
24 module.exports = result;
25 } else {
26 module.exports = result.toString();
27 }
28 `;
29};