
import process from 'node:process'

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  devtools: { enabled: true },
  runtimeConfig: {
    API_ORIGIN: process.env.NUXT_API_ORIGIN || 'http://localhost:3000',
    public: {
      API_ORIGIN: process.env.NUXT_API_ORIGIN || 'http://localhost:3000',
    }
  },
  ssr: false,

  // SPA optimizations
  router: {
    options: {
      hashMode: false, // Use history mode for cleaner URLs
    },
  },

  // Enable client-side rendering optimizations
  nitro: {
    prerender: {
      crawlLinks: false, // Disable crawling for SPA
    },
  },

  // Optimize app loading
  app: {
    head: {
      viewport: 'width=device-width,initial-scale=1',
      charset: 'utf-8',
    },
  },

  modules: [
    '@unocss/nuxt',
    '@vueuse/nuxt',
    '@nuxt/eslint',
    '@nuxt/icon',
    '@pinia/nuxt',
    '@nuxtjs/color-mode',
    '@nuxtjs/tailwindcss',
    'shadcn-nuxt',
  ],

  css: ['@unocss/reset/tailwind.css', '~/assets/css/main.css'],

  colorMode: {
    classSuffix: '',
  },

  features: {
    // For UnoCSS
    inlineStyles: false,
  },

  eslint: {
    config: {
      standalone: false,
    },
  },

  imports: {
    dirs: ['./app/lib'],
  },
  shadcn: {
    prefix: '',
    componentDir: './app/components/pub/ui',
  },

  compatibilityDate: '2025-07-15',
})
