From 55fb01b23c3274839cf00d32852e9246b1b7de72 Mon Sep 17 00:00:00 2001 From: Will Freeman Date: Mon, 8 Dec 2025 22:43:02 -0700 Subject: [PATCH] improve chunking, iconRegistry component --- webapp/src/components/icons/IconRegistry.vue | 97 ++++++++++++++++++++ webapp/vite.config.ts | 26 ++++++ 2 files changed, 123 insertions(+) create mode 100644 webapp/src/components/icons/IconRegistry.vue diff --git a/webapp/src/components/icons/IconRegistry.vue b/webapp/src/components/icons/IconRegistry.vue new file mode 100644 index 0000000..d3269ae --- /dev/null +++ b/webapp/src/components/icons/IconRegistry.vue @@ -0,0 +1,97 @@ + + + \ No newline at end of file diff --git a/webapp/vite.config.ts b/webapp/vite.config.ts index 7e3bf6f..b86a09f 100644 --- a/webapp/vite.config.ts +++ b/webapp/vite.config.ts @@ -16,5 +16,31 @@ export default defineConfig({ server: { host: '0.0.0.0', port: 5173, + }, + build: { + rollupOptions: { + output: { + manualChunks(id) { + // Group all iconify imports into a separate chunk + if (id.includes('@iconify-vue/mdi') || id.includes('@iconify-vue/ic')) { + return 'iconify-icons' + } + // Group Vue and router into vendor chunk + if (id.includes('vue') || id.includes('vue-router') || id.includes('pinia')) { + return 'vue-vendor' + } + // Group Vuetify into its own chunk since it's large + if (id.includes('vuetify')) { + return 'vuetify' + } + // Group Leaflet mapping into its own chunk + if (id.includes('leaflet')) { + return 'leaflet' + } + } + } + }, + // Increase the chunk size warning limit since we're dealing with icons + chunkSizeWarningLimit: 1000 } })