#Browser performance during dev

1 messages · Page 1 of 1 (latest)

ripe umbra
#

Hi, we're migrating a large codebase to vite but while it works, the browser becomes unbearably slow due to the whole modules in browser thing. Is the only way to make it bearable by aggressively lazy loading? This is a react SPA codebase

dull torrent
#

In general, transform phase will lower performance, so check some packages you imported whether include large numbers of sub-modules. For example, the first way will cost less time:

// first
import last from 'lodash/last'

// second
import { last } from 'lodash'
ripe umbra
#

yeah i've done that for the most part but theres still a lot of modules being loaded, ~2.2k according to the network tab

dull torrent
ripe umbra
#

it's a bit difficult to copy over a massive mono-repo over to stack blitz 😅 was mostly just wondering if there were any good readings on some best practices for large code bases that use vite