This handles embedding 'bin' scripts with shebang interpreter directives at the start

This commit is contained in:
Christopher Karper
2015-02-15 15:02:58 -05:00
parent f784c79ca1
commit 7a25c2bfd9
+4
View File
@@ -96,6 +96,10 @@ function bundle (input, complete) {
//this is the result of require("someFile.json"), so we need to export it from the function
req += "module.exports = "
}
if ((/^\#\!/).test(dep.source)) {
dep.source = '//' + dep.source;
}
req += dep.source + "}";
dbuffer.push(JSON.stringify(dep.id) + ": ["+req+", "+!!dep.entry+", "+JSON.stringify(dep.deps)+"]")