From 3992a9c81c8f47e39ec7388c7af5ee7e1cf7eb3f Mon Sep 17 00:00:00 2001 From: Stephan Date: Tue, 31 Mar 2026 09:14:49 +0200 Subject: [PATCH] fix: maplibre-gl runtime errors in production build by isoliting it into a chunk (#288) --- vite.config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vite.config.js b/vite.config.js index 0a7f959..d44d0c1 100644 --- a/vite.config.js +++ b/vite.config.js @@ -12,6 +12,18 @@ export default defineConfig({ chunkSizeWarningLimit: 9999999, outDir: './ui/public', emptyOutDir: true, + rollupOptions: { + output: { + manualChunks(id) { + if (id.includes('node_modules/maplibre-gl')) { + return 'maplibre-gl'; + } + }, + }, + }, + }, + optimizeDeps: { + include: ['maplibre-gl'], }, plugins: [react()], server: {