File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -642,13 +642,14 @@ res.send(`
642642 <body>
643643 <div id="app">${ html} </div>
644644 <script src="/dist/manifest.js"></script>
645+ <script src="/dist/main.js"></script>
645646 ${ bundles .map (bundle => {
646647 return ` <script src="/dist/${ bundle .file } "></script>`
647648 // alternatively if you are using publicPath option in webpack config
648649 // you can use the publicPath value from bundle, e.g:
649650 // return `<script src="${bundle.publicPath}"></script>`
650651 }).join (' \n ' )}
651- <script src="/dist/main.js"> </script>
652+ <script>window.main(); </script>
652653 </body>
653654 </html>
654655` );
@@ -669,9 +670,11 @@ import ReactDOM from 'react-dom';
669670import Loadable from ' react-loadable' ;
670671import App from ' ./components/App' ;
671672
672- Loadable .preloadReady ().then (() => {
673- ReactDOM .hydrate (< App/ > , document .getElementById (' app' ));
674- });
673+ window .main = () => {
674+ Loadable .preloadReady ().then (() => {
675+ ReactDOM .hydrate (< App/ > , document .getElementById (' app' ));
676+ });
677+ };
675678
676679```
677680
You can’t perform that action at this time.
0 commit comments