You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functions that aren't defined as top-level properties of args are not making through to the loaded module source. So for example, this works fine:
// another-require.jsrequire('something');// index.jsrequire=require('really-need');require('./another-require',{args: {require: function(name){console.log('no requires allowed');}}});// prints "no requires allowed"
... but this doesn't:
// stuff-with-lodash.jsconsole.log(_.yam);_.filter();// index.jsrequire=require('really-need');require('./stuff-with-lodash',{args: {_: {'yam': 678,'filter': function(){console.log('look! a fake lodash filter!');}}}});// prints:// 678// _.filter is not a function
I already hacked together something that works using a dusty gist by @cowboy but I'm not in love with it.
Let me know if this is something you think worth looking into.
The text was updated successfully, but these errors were encountered:
Functions that aren't defined as top-level properties of
args
are not making through to the loaded module source. So for example, this works fine:... but this doesn't:
I already hacked together something that works using a dusty gist by @cowboy but I'm not in love with it.
Let me know if this is something you think worth looking into.
The text was updated successfully, but these errors were encountered: