2025-12-11 10:40:55 +01:00
|
|
|
/*
|
2026-01-12 15:00:36 +01:00
|
|
|
* Copyright (c) 2026 by Christian Kellner.
|
2025-12-11 10:40:55 +01:00
|
|
|
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2022-12-19 21:44:10 +01:00
|
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
|
import { defineConfig } from 'vite';
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
|
export default defineConfig({
|
2026-06-10 16:44:39 +02:00
|
|
|
// Must be absolute: with a relative base, asset URLs in index.html break on
|
|
|
|
|
// deep links like /listings/listing/:id (the SPA fallback serves index.html,
|
|
|
|
|
// but ./assets/* then resolves below the route path and loads HTML as JS).
|
|
|
|
|
base: '/',
|
2022-12-19 21:44:10 +01:00
|
|
|
build: {
|
|
|
|
|
chunkSizeWarningLimit: 9999999,
|
|
|
|
|
outDir: './ui/public',
|
2025-07-25 13:13:04 +02:00
|
|
|
emptyOutDir: true,
|
2026-03-31 09:14:49 +02:00
|
|
|
rollupOptions: {
|
|
|
|
|
output: {
|
|
|
|
|
manualChunks(id) {
|
|
|
|
|
if (id.includes('node_modules/maplibre-gl')) {
|
|
|
|
|
return 'maplibre-gl';
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
optimizeDeps: {
|
|
|
|
|
include: ['maplibre-gl'],
|
2022-12-19 21:44:10 +01:00
|
|
|
},
|
|
|
|
|
plugins: [react()],
|
|
|
|
|
server: {
|
|
|
|
|
proxy: {
|
|
|
|
|
'/api': {
|
|
|
|
|
target: {
|
|
|
|
|
host: '0.0.0.0',
|
|
|
|
|
protocol: 'http:',
|
|
|
|
|
port: 9998,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|