Closed unional closed 7 years ago
I think this is more userland tbh.
Have you taken a look at prepack or closure compiler?
This could only really be implemented at the VM level (V8), because it requires substantial static analysis. Also, it can't actually avoid loading or creating anything observable without implementor hooks (e.g. .on("unhandledRejection", ...)
), because that would be in violation of the ES spec.
So IMHO this is something best asked on the es-discuss mailing list and the like, not here.
Answered, closing.
Have it / can it / should it be considered?
The only benefit seems to be saving some memory consumption for the module resolution. But if all references are resolved at runtime, then there is no benefit to be observed?
Or this may be fit into a larger discussion of "when to build"? 🌷