hi, it's Yasmin

Resolving a slow initial page load on a new Vite project

I started a new personal project to play around with a Vite & Mantine combo. After adding 2 components from Mantine UI, it became VERY slow- 10+ seconds to do a page load with the browser becoming a bit unresponsive.

I saw on the Network tab that I was getting spammed with chunks; 5000+ requests:

Screenshot 2025-01-21 091847

Each chunk was an icon from Tabler, the icon library that Mantine uses by default. Even though I was only using/importing one, it was chunking it all.

The solution was found here- I had to update my vite.config.js file.

#frontend #mantine #vite