script-loader
Advanced tools
Comparing version 0.3.1 to 0.5.0
@@ -1,1 +0,10 @@ | ||
module.exports = function() {} | ||
/* | ||
MIT License http://www.opensource.org/licenses/mit-license.php | ||
Author Tobias Koppers @sokra | ||
*/ | ||
module.exports = function(src) { | ||
if (window.execScript) | ||
window.execScript(src); | ||
else | ||
eval.call(null, src); | ||
} |
15
index.js
@@ -6,10 +6,8 @@ /* | ||
var path = require("path"); | ||
var loaderUtils = require("loader-utils"); | ||
module.exports = function(content) { | ||
module.exports = function() {}; | ||
module.exports.pitch = function(remainingRequest) { | ||
this.cacheable && this.cacheable(); | ||
this.clearDependencies && this.clearDependencies(); | ||
var rawJs = loaderUtils.getRemainingRequest(this); | ||
return "require(" + JSON.stringify(path.join(__dirname, "addScript" + (this.web ? ".web" : "") + ".js")) + ")"+ | ||
return "require(" + JSON.stringify("!" + path.join(__dirname, "addScript.js")) + ")"+ | ||
"(require(" + | ||
JSON.stringify("raw" + rawJs) + ")" + | ||
JSON.stringify("!raw!" + remainingRequest) + ")" + | ||
(this.debug ? | ||
@@ -19,7 +17,6 @@ "+" + | ||
"\n\n// SCRIPT-LOADER FOOTER\n//@ sourceURL=script:///" + | ||
encodeURI(rawJs.replace(/^!/, "")).replace(/%5C|%2F/g, "/").replace(/\?/, "%3F").replace(/^\//, "") | ||
encodeURI(remainingRequest.replace(/^!/, "")).replace(/%5C|%2F/g, "/").replace(/\?/, "%3F").replace(/^\//, "") | ||
) : | ||
"") + | ||
")"; | ||
} | ||
module.exports.seperable = true; | ||
}; |
{ | ||
"name": "script-loader", | ||
"version": "0.3.1", | ||
"version": "0.5.0", | ||
"author": "Tobias Koppers @sokra", | ||
"description": "script loader module for webpack", | ||
"dependencies": { | ||
"raw-loader": "0.1.x", | ||
"loader-utils": "0.1.x" | ||
"raw-loader": "0.5.x" | ||
}, | ||
@@ -15,4 +14,3 @@ "licenses": [ | ||
} | ||
], | ||
"license": "MIT" | ||
] | ||
} |
1
1475
5
29
+ Addedraw-loader@0.5.1(transitive)
- Removedloader-utils@0.1.x
- Removedjson5@0.1.0(transitive)
- Removedloader-utils@0.1.2(transitive)
- Removedraw-loader@0.1.6(transitive)
Updatedraw-loader@0.5.x