3 ms·
Note this: acc[camelcase(dependency)] = require(dependency); could be replaced with: Object.defineProperty(acc,camelcase(dependency),{get:function(){
by geocar 12y ago
Note this:
acc[camelcase(dependency)] = require(dependency);
could be replaced with:
Object.defineProperty(acc,camelcase(dependency),{get:function(){ return require(dependency) }})
and you'd get demand-loading!
- eldude 12y agoAnd you'd be hiding the blocking on the require call, the primary reason why on-demand loading is an anti-pattern in node.