Open reggi opened 9 years ago
Right, that could be a meaningful enhancement for adding other loads (like spy/curl/etc). What API were you thinking to use this @reggi? Something like
var imports = umd(ast, {
es6: true, amd: false, cjs: true,
customLoads: [{
test: node => node.callee.name === 'customLoader',
parse() { // optional
// manipulate the node as desired
}
}]
});
Yeah that functionality looks great.
I'm trying to track down required files and some of them are files I'm loading using
readFileSync
.I thought it should be possible for me to wrap this functionality like this:
And be able to add
customLoader
to return these in the returned list of modules.Thoughts?