Closed arve0 closed 4 years ago
@arve0 Yes, load-plugins doesn't support this. Tell me please, why you need lazy loading?
plugins are a pretty good use case for lazy loading. I've been using it a lot lately.
why you need lazy loading?
It ensures that only the modules that are actually used are required in. It can have a pretty dramatic effect on initialization time.
why you need lazy loading?
I might not actually need it, was just curious and pre-optimizing.
@jonschlinkert Why this module? I thought requires caches by node natively.
I thought requires caches by node natively.
It does... after it requires in the module. The point of the "lazy" part of lazy-requiring is that a module isn't cached or loaded at all unless it's actually used at some point. e.g. there might be a module that is only used when a certain option is set. That's a good example of a dep that would benefit from being lazily required
I see gulp-load-plugins uses lazy loading. If I understand plugins correctly, load-plugins does not lazy load?