// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  ssr: false,  // SPA 모드 활성화
  nitro: {
    prerender: {
      routes: ['/'],  // 오직 루트 페이지만 prerender
      crawlLinks: false  // 자동 크롤링 비활성화
    }
  },
  app: {
    head: {
      titleTemplate: '',
      title: '파이럿존',
      htmlAttrs: {
        lang: 'ko'
      },
      link: [
        { rel: 'icon', type: 'image/x-icon', href: '' },
      ],
      script: [
        {
          src: '//wcs.pstatic.net/wcslog.js',
          type: 'text/javascript'
        },
        {
          type: 'text/javascript',
          innerHTML: ``
        }
      ]
    },
  },  
  modules: ['@nuxt/ui'],
  ui: {
    colorMode: false
  },
  css: [
    '~/assets/scss/style.scss',
    '~/assets/scss/admin.scss',
  ],
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: ''
        }
      }
    },
    server: {
      watch: {
        usePolling: true,  // Windows 파일 감시 안정화
      }
    },
    optimizeDeps: {
      exclude: ['sass']
    }
  },
  compatibilityDate: '2025-07-15',
  devtools: { enabled: false },
  devServer: {
    host: "0.0.0.0"
  },
  runtimeConfig: {
    public: {
      apiBase: process.env.NUXT_PUBLIC_API_BASE,
      imageBase: process.env.NUXT_PUBLIC_IMAGE_BASE,
      mediaBase: process.env.NUXT_PUBLIC_MEDIA_BASE,
      googleMapKey: process.env.NUXT_PUBLIC_GOOGLE_MAP_KEY,
    }
  }
})