Files
hnh-map/frontend-nuxt/nuxt.config.ts
Nikolay Tatarinov fea17e6bac Refactor routing and documentation for SPA deployment
- Updated the application to serve the SPA from the root path instead of /map/, enhancing accessibility.
- Modified redirect logic to ensure backward compatibility with old /map/* URLs.
- Adjusted documentation across multiple files to reflect the new routing structure and API endpoints.
- Improved handling of OAuth redirects and session management in the backend.
- Updated frontend configuration to align with the new base URL settings.
2026-02-25 00:32:59 +03:00

55 lines
1.7 KiB
TypeScript

// https://nuxt.com/docs/api/configuration/nuxt-config
import { viteUriGuard } from './vite/vite-uri-guard'
export default defineNuxtConfig({
compatibilityDate: '2024-11-01',
devtools: { enabled: true },
app: {
baseURL: '/',
pageTransition: { name: 'page', mode: 'out-in' },
head: {
title: 'HnH Map',
meta: [{ charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }],
link: [
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
{ rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' },
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap' },
],
},
},
ssr: false,
runtimeConfig: {
public: {
apiBase: '/map/api',
},
},
modules: ['@nuxtjs/tailwindcss'],
tailwindcss: {
cssPath: '~/assets/css/app.css',
},
css: ['~/assets/css/app.css', 'leaflet/dist/leaflet.css', '~/assets/css/leaflet-overrides.css'],
vite: {
plugins: [viteUriGuard()],
optimizeDeps: {
include: ['leaflet'],
},
},
// Dev: proxy /map API, SSE and grids to Go backend (e.g. docker compose -f docker-compose.dev.yml)
nitro: {
devProxy: {
'/map/api': { target: 'http://backend:3080', changeOrigin: true },
'/map/updates': { target: 'http://backend:3080', changeOrigin: true },
'/map/grids': { target: 'http://backend:3080', changeOrigin: true },
},
},
// For cutover: set nitro.preset to 'static' and optionally copy .output/public to ../frontend
// nitro: { output: { dir: '../frontend' } },
})