ES proposal: import()
at www.2ality.com▼18 up and 0 down, posted by
18 up and 0 down, posted by
Doesn't this also make tree-shaking basicly impossible? Since the tree-shaking tool can't just strip code away because it doesn't know if that code was importet somewhere via dynamic import().
I don't agree that those modules should never be part of the bundle. For example, you could have language files and load them with a function like "loadLang = lang => import(`./languages/${lang}`)". It is totally debatable if those language files should be part of the bundle or not and a decision the developer has to make.