Skip to content
This repository was archived by the owner on Nov 5, 2019. It is now read-only.

Commit 70820c8

Browse files
committed
better debugging
1 parent d090194 commit 70820c8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ module.exports = function(content) {
1010
var rawJs = loaderUtils.getRemainingRequest(this);
1111
return "require(" + JSON.stringify(path.join(__dirname, "addScript" + (this.web ? ".web" : "") + ".js")) + ")"+
1212
"(require(" +
13-
JSON.stringify("raw" + rawJs) + "))";
13+
JSON.stringify("raw" + rawJs) + ")" +
14+
(this.debug ?
15+
"+" +
16+
JSON.stringify(
17+
"\n\n// SCRIPT-LOADER FOOTER\n//@ sourceURL=script:///" +
18+
encodeURI(rawJs.replace(/^!/, "")).replace(/%5C|%2F/g, "/").replace(/\?/, "%3F").replace(/^\//, "")
19+
) :
20+
"") +
21+
")";
1422
}
1523
module.exports.seperable = true;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "script-loader",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"author": "Tobias Koppers @sokra",
55
"description": "script loader module for webpack",
66
"dependencies": {

0 commit comments

Comments
 (0)