Commit cb3cfec
committed
Only import the top-level index route when SSRing SPA mode's index.html
Since we only actually render the top-level index route in SPA mode, we
don't need to import any other routes in the server bundle; the bundle is
solely used to generate the index.html file, and is subsequently discarded.
This should speed up SPA mode builds and make them less error prone; often
times apps use libraries that are not SSR-capable (e.g. referencing window
in the module scope). By excluding all other routes (and their deps), we
make the index.html render more likely to be successful and less likely to
require a bunch of externals/shimming shenanigans in vite.config.js.1 parent fbea1ea commit cb3cfec
File tree
2 files changed
+133
-8
lines changed- integration
- packages/react-router-dev/vite
2 files changed
+133
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1067 | 1067 | | |
1068 | 1068 | | |
1069 | 1069 | | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
1070 | 1166 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
600 | 612 | | |
601 | 613 | | |
602 | 614 | | |
603 | 615 | | |
604 | 616 | | |
605 | 617 | | |
606 | 618 | | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
613 | 631 | | |
614 | 632 | | |
615 | 633 | | |
| |||
626 | 644 | | |
627 | 645 | | |
628 | 646 | | |
629 | | - | |
| 647 | + | |
630 | 648 | | |
631 | 649 | | |
632 | 650 | | |
| |||
1394 | 1412 | | |
1395 | 1413 | | |
1396 | 1414 | | |
1397 | | - | |
| 1415 | + | |
1398 | 1416 | | |
1399 | 1417 | | |
1400 | 1418 | | |
| |||
2587 | 2605 | | |
2588 | 2606 | | |
2589 | 2607 | | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
2590 | 2619 | | |
2591 | 2620 | | |
2592 | 2621 | | |
| |||
0 commit comments