I tried to code split with react-loadable by route. It seems to slow down performance since there will be more files to load. I know that the reason why it is general practice to make one bundle file is that small multiple files slow down on http 1. So I am wondering if I did wrong in my code splitting or It is generally slow down performance in http 1?? Also total file size got bigger since some of the common components are in multiple chunk.js. Am i doing it wrong ?
Asked
Active
Viewed 1,448 times
1 Answers
0
- If you are doing chunks module wise, then different chunks are loaded only when demanded. If you think this is degrading, then you can proactively start remaining chunk downloading in component load event.
- The build performance will degrade. https://github.com/webpack/webpack/issues/4636 If you are using import, the build time can be increased as much as 5-10 times.
- If size is a concern use gzip to reduce the size while serving static content
Hope this helps

Shiv
- 199
- 5
- 16