forked from webpack-contrib/script-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
20 lines (20 loc) · 710 Bytes
/
index.js
File metadata and controls
20 lines (20 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var path = require("path");
module.exports = function() {};
module.exports.pitch = function(remainingRequest) {
this.cacheable && this.cacheable();
return "require(" + JSON.stringify("!!" + path.join(__dirname, "addScript.js")) + ")"+
"(require(" +
JSON.stringify("!!" + require.resolve("raw-loader") + "!" + remainingRequest) + ")" +
(this.debug ?
"+" +
JSON.stringify(
"\n\n// SCRIPT-LOADER FOOTER\n//# sourceURL=script:///" +
encodeURI(remainingRequest.replace(/^!/, "")).replace(/%5C|%2F/g, "/").replace(/\?/, "%3F").replace(/^\//, "")
) :
"") +
")";
};