TanStackT
TanStack6mo ago
1 reply
colossal-harlequin

IIFE build option with code splitting?

Hi all,

My apps require them to be built wrapped in an IIFE, I typically use the format option in vite build config for this (see screenshot)

I want to move these apps to TS router, however, when I have this option in my vite build, I lose code splitting with .lazy routes.

Is there anyway I can output my TS router apps wrapped in an iife?
Screenshot_2025-07-30_at_10.21.49.png
Was this page helpful?