ModusCreateOrg/react-dynamic-route-loading-es6

How to lazy load only the child routes modules for the route user goes to

inf3cti0n95 opened this issue · 2 comments

Shouldnt the lazy load work like it should preload only the routes for the that the user might take from its current path.

While the code of yours preloads all the chunks whether they are child of the route or not.

e.g.

If the Main Route is / with child routes /A, /B, /C

and the route /A having child routes /A/1, /A/2

the app should preload A,B,C chunk when on route /
and it should preload 1,2 chunk when on route /A

Can you suggest me how could we implement that

grgur commented

That's an excellent question. AFAIK, something the world is yet to be developed. Any ideas?

Hmm, I am pretty newbie at the Webpack Plugin Making so I don't have any idea, but would love to contribute if you have something in mind. This kind of plugin would be of great potential.