How will dynamic import working in Meteor 1.5?

I use dynamic import with react at page level, what I expect is that the page file and all it’s imports will be split out from the initial app, but it seems that only the page file itself was loaded lazily, all it’s dependencies were still packed up into meteor app module, this makes dynamic import less useful in my case.

An counterpart is Next.js. It packs a page and all it’s dependencies as a chunk and splits them out as a whole together. By this way, every single page reaches it’s smallest size, but the whole app size will be larger for not reusing common modules.

Does / Will Meteor do such a things in a smarter way? Or give some way to config common modules ( like vendor modules in webpack )?

1 Like

do you use imports-directory?

due to legacy reasons, meteor evaulates everything eargerly thats not in an imports directory

yes, I put almost all my code in the imports dir.