Warmup most common entrypoints in Vite
What does this MR do and why?
This change speeds up the requests for most common entrypoints at GitLab: main.js and super_sidebar.js. This should give a boosted performance on a cold start of GDK.
| JS file | Before | After |
|---|---|---|
| javascripts/main.js | ~170ms | ~35ms |
How to set up and validate locally
- Disable Caching in DevTools.
- Do a cold start of Vite.
gdk stop vite && rm -rf node_modules/.vite && gdk start vite - Open any page.
- Measure the time to get
javascripts/main.js(notjavascripts/entrypoints/main.js!) - Repeat this without the change.
- Compare numbers.