import Aura from '@primeuix/themes/aura'
import tailwindcss from '@tailwindcss/vite'

export default defineNuxtConfig({
  compatibilityDate: '2025-09-29',
  devtools: { enabled: true, vueDevTools: true },
  ssr: false,
  modules: [
    '@nuxt/fonts',
    '@primevue/nuxt-module',
    '@formkit/auto-animate/nuxt',
  ],
  primevue: {
    options: {
      theme: {
        preset: Aura,
      },
    },
    components: {
      prefix: 'Prime',
    },
  },
  css: [
    '@/assets/styles/tailwind.css',
    '@/assets/styles/primeicons.css',
    '@/assets/styles/main.scss',
  ],
  devServer: {
    // host: '0',
  },
  vite: {
    plugins: [
      tailwindcss(),
    ],
    clearScreen: false,
    envPrefix: ['VITE_', 'TAURI_'],
    server: {
      strictPort: true,
      proxy: {
        '/api': {
          // target: 'http://localhost:4000',
          target: 'https://api.koptilnya.xyz',
          changeOrigin: true,
          rewrite: path => path.replace(/^\/api/, '/chad'),
        },
      },
    },
    define: {
      __COMMIT_SHA__: JSON.stringify(import.meta.env.COMMIT_SHA || 'local'),
    },
  },
  ignore: ['**/src-tauri/**'],
})
