Answer the question
In order to leave comments, you need to log in
How to load part of a React bundle only when following a route?
Let's say in my application there is a page with a resource-intensive calculator. How to optimize the build so that this calculator is collected in a separate file and not loaded along with the main js file until it is requested by explicitly going to its page?
Answer the question
In order to leave comments, you need to log in
https://ru.reactjs.org/docs/code-splitting.html#co...
see section "Code splitting based on routes"
Webpack itself knows how to beat the code into chunks quite well. You can google for the name of the splitChunks option, I think
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question