import tailwindcss from '@tailwindcss/vite' // Generování verze při buildu function generateBuildVersion(): string { const now = new Date() const year = now.getFullYear() const month = String(now.getMonth() + 1).padStart(2, '0') const day = String(now.getDate()).padStart(2, '0') const hours = String(now.getHours()).padStart(2, '0') const minutes = String(now.getMinutes()).padStart(2, '0') const seconds = String(now.getSeconds()).padStart(2, '0') // Formát: YYYYMMDD-HHMMSS return `${year}${month}${day}-${hours}${minutes}${seconds}` } // Verze se generuje při každém buildu const buildVersion = generateBuildVersion() // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ compatibilityDate: '2025-05-15', devtools: { enabled: false }, experimental: { payloadExtraction: false, clientNodeCompat: true }, ssr: true, // SSR zapnuto i ve vývoji css: ['~/assets/css/app.css'], modules: [ '@nuxt/image', '@nuxt/scripts', '@nuxt/eslint', '@nuxtjs/device', '@vueuse/nuxt', '@pinia/nuxt' ], // ------------------------------------------------- // Vite konfigurace pro stabilní HMR na Windows // ------------------------------------------------- vite: { define: { __BUILD_VERSION__: JSON.stringify(buildVersion) }, plugins: [ tailwindcss(), { name: 'reload-pages', handleHotUpdate({ file, server }) { if (file.includes('/pages/')) { // full reload při změně stránky → SSR se projeví server.ws.send({ type: 'full-reload' }) } } } ] // build: { // commonjsOptions: { // exclude: ['@vueuse/core'] // } // } }, nitro: { preset: 'netlify', compressPublicAssets: true, minify: true, prerender: { crawlLinks: false, routes: ['/'], failOnError: false }, runtimeConfig: { public: { buildVersion: buildVersion } } }, image: { dir: 'assets', quality: 80, format: ['webp', 'avif', 'jpg', 'png'], screens: { xs: 320, sm: 640, md: 768, lg: 1024, xl: 1280, xxl: 1536 } }, runtimeConfig: { apiSecret: '', public: { apiBase: '/api', googleMapsApiKey: '', siteUrl: 'https://portin.netlify.app/', buildVersion: buildVersion } }, app: { head: { charset: 'utf-8', viewport: 'width=device-width, initial-scale=1', htmlAttrs: { class: 'scroll-smooth' }, title: 'Premier Retail Park Development', meta: [ { name: 'description', content: 'Leading retail park developer creating innovative commercial spaces and shopping destinations.' }, { name: 'theme-color', content: '#012D5A' } ], link: [ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }, { rel: 'preconnect', href: 'https://fonts.googleapis.com' }, { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' }, { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400;1,9..40,500;1,9..40,600;1,9..40,700&family=Inter:wght@400;500;600;700&display=swap' } ] } }, hooks: { 'pages:extend'(pages) { pages.push({ name: 'Dev Team', path: '/nas-tym', file: '~/pages/devTeam.vue' }) }, 'nitro:config'(nitroConfig) { // Generovat novou verzi při každém buildu Nitro const newVersion = generateBuildVersion() if (nitroConfig.runtimeConfig) { nitroConfig.runtimeConfig.public = nitroConfig.runtimeConfig.public || {} nitroConfig.runtimeConfig.public.buildVersion = newVersion } } }, components: [ { path: '~/components/aw', pathPrefix: false }, { path: '~/components/contact', pathPrefix: false }, { path: '~/components/hero', pathPrefix: false }, { path: '~/components/media', pathPrefix: false }, { path: '~/components/news', pathPrefix: false }, { path: '~/components/partners', pathPrefix: false }, { path: '~/components/projects', pathPrefix: false }, { path: '~/components/shared', pathPrefix: false }, '~/components' ] })