// https://nuxt.com/docs/api/configuration/nuxt-config
import 'dotenv/config';

export default defineNuxtConfig({
  modules: [
    '@nuxtjs/tailwindcss',
    '@nuxt/fonts',
    '@pinia/nuxt',
    'pinia-plugin-persistedstate/nuxt',
    '@nuxt/eslint',
    '@nuxt/image',
    '@nuxtjs/i18n',
  ],
  ssr: false,
  imports: {
    dirs: ['types/*.ts', 'store/*.ts', 'types/**/*.ts'],
  },
  devtools: { enabled: true },
  css: ['~/assets/css/tailwind.css'],
  runtimeConfig: {
    public: {
      cdn_url: process.env.CDN_URL,
    },
  },
  routeRules: {
    '/': { prerender: true },
  },
  compatibilityDate: '2025-12-17',
  eslint: {
    config: {
      stylistic: {
        indent: 2,
        semi: true,
        quotes: 'single',
        jsx: false,
      },
    },
  },
  i18n: {
    locales: [
      { code: 'pl', language: 'pl-PL', file: 'pl.json' },
      { code: 'en', language: 'en-GB', file: 'en.json' },
      { code: 'de', language: 'de-DE', file: 'de.json' },
      { code: 'ua', language: 'uk-UK', file: 'ua.json' },
    ],
    defaultLocale: 'pl',
  },
  image: {
    providers: {
      selfhost: {
        name: 'selfhost',
        provider: '~~/providers/selfhost.ts',
        options: {
          baseUrl: process.env.CDN_URL,
        },
      },
    },
    provider: 'selfhost',
  },
  tailwindcss: { exposeConfig: true },
});
