Merge pull request #100 from CKarper/master
Stub to ignore require('sys')
This commit is contained in:
+9
-4
@@ -61,16 +61,17 @@ function bundle (input, complete) {
|
||||
|
||||
},
|
||||
filter: function (id) {
|
||||
if (id == 'nexeres') { return false; } //treat our new moudle as a builtin module
|
||||
if (id == 'nexeres') { return false; } //treat our new module as a builtin module
|
||||
return !~builtins.indexOf(id);
|
||||
},
|
||||
extensions: ['.js', '.json' ],
|
||||
ignoreMissing: true
|
||||
extensions: [ '.js', '.json' ],
|
||||
ignoreMissing: true,
|
||||
modules: { sys: __dirname + '/empty.js' }
|
||||
});
|
||||
|
||||
/** event for missing packages, fixes conditional requires **/
|
||||
md.on('missing', function(id, parent) {
|
||||
_log("warn", "couldn't find require '"+id+"', errors may occur.");
|
||||
_log("warn", "couldn't find require '" + id + "', errors may occur.");
|
||||
});
|
||||
|
||||
md.pipe(through(function (chunk) {
|
||||
@@ -95,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)+"]")
|
||||
|
||||
Reference in New Issue
Block a user