I am developing an app with webpack/react/redux/node and have already implemented Server Side Rendering. Everything works so far, so I rather have a general question. I used webpack to bundle my JS files and also activated code splitting. Therefore I have two bundles:
- bundle.js (my Components and custom code)
- vendor.js (react/redux modules)
Now, as far as I know, when I place both of these in a normal <script> tag, the browser waits until the page and all resources are fully loaded to display anything. That way I lose the performance benefits of SSR, don't I?
I mean the page still gets parsed by Web crawlers, e.g. google, but a user still has to wait for the page to be fully loaded, before seeing anything.
I think putting async in the script tag would solve the problem, e.g.:
<script async src='/vendor.js'></script>
<script async src='/bundle.js'></script>
However, with async in the tag, vendor.js will normally be finished loading after bundle.js, since it is a bigger file.
Is there something I got wrong or is there a solution for this problem?
deferfor the script tags, does it defeat the purpose of SSR?