I tried to check the size of my starter project with the bundle-visualizer package.
I used the command meteor --extra-packages bundle-visualizer --production and my packages include
standard-minifier-css@1.3.4 # CSS minifier run for production mode
standard-minifier-js@2.1.1 # JS minifier run for production mode
But as you can see in the image below, my react-dom is around 195kB, but if I open node_modules\react-dom\dist I can find that it is supposed to be 128kB minified.
jQuery is 96.5kB which is big but consistent with its minified version, and react itself is around 40kB.
For those interested, jagi:astronomy is 178kB and viewmodel-react is 50.2kB.
With everything together it’s already 1MB.
The question is: what to do for react-dom, and is my bundle-size optimizable ?
I have eliminated jQuery from my react project and I used code splitting to reduce my bundle size. Preact seems like a reasonable alternative to react if you want to further reduce your bundle size.
Yeah I don’t even think that’s doable. I used code splitting for speed up the initial load by deferring the non-critical parts of the app. I also have react-dom in my initial bundle along with react-bootstrap which is also big. For the react-dom the only solution I found is to use preact.
But as you can see in the image below, my react-dom is around 195kB, but if I open node_modules\react-dom\dist I can find that it is supposed to be 128kB minified.