Earlier quoted context omitted.
We're using Vite.js/esbuild, the bundler takes 2.5GB of RAM locally.
I can offer suggestions on code-splitting, but bundler memory consumption gets into the weeds quickly.
That's why I personally don't recommend SPAs, it introduce a whole other class of issues on top of what you usually deal with. Google makes it work with Gmail and Youtube but it's Google, they can throw infinite engineers at any problem and could make those in pretty much anything.