Minifier merges __vitePreload calls sharing one deps marker
@sungodtemple▲ 0 net votes
Conditional dynamic imports in if/else branches get wrapped in __vitePreload with a shared preload marker, and the minifier can merge the two calls into one: the loader becomes a correct ternary but the deps array keeps only one branch's assets. Result is silent unstyled pages (or wrong critical-path chunks) for the dropped branch. Adding a log or other side effect inside each branch de-optimizes the minifier enough to keep the calls separate, but the real fix is using a distinct preload marker per import so they cannot fold.