// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  future: {
    compatibilityVersion: 4,
  },

  compatibilityDate: '2024-11-01',
  devtools: { enabled: true },
  modules: [
    '@nuxtjs/tailwindcss',
    '@nuxtjs/color-mode',
    '@nuxtjs/i18n',
    '@nuxtjs/sitemap',
    '@vesp/nuxt-fontawesome',
    '@pinia/nuxt',
    [
      '@vee-validate/nuxt',
      {
        autoImports: true,
        componentNames: {
          Form: 'VeeForm',
          Field: 'VeeField',
          FieldArray: 'VeeFieldArray',
          ErrorMessage: 'VeeErrorMessage',
        },
      },
    ],
    'vue3-carousel-nuxt',
  ],

  app: {
    pageTransition: { name: 'page', mode: 'out-in' },
  },
  css: [
    './public/assets/css/tailwind.css',
    './public/assets/css/ckeditor-dark.css',
  ],
  plugins: ['~/plugins/fontawesome'],

  colorMode: {
    preference: 'system', // default value of $colorMode.preference
    fallback: 'light', // fallback value if not system preference found
    classSuffix: '',
  },
  site: {
    // urls: async () => {
    //   // fetch your URLs from a database or other source
    //   // const urls = await fetch("https://example.com/api/urls");
    //   // return urls;
    // },
    name: 'Normad Bobu',
    routeRules: {
      '/shop': { prerender: true },
      '/shop/**': { robots: true },
      '/cms/**': { robots: false },
      '/login': { robots: false },
    },
  },
  nitro: {
    prerender: {
      crawlLinks: false,
      routes: ['/', '/shop', '/projects', '/contact'],
      ignore: ['/cms', '/cms/upload', '/kr/cms', '/kr/cms/upload'],
    },
    firebase: {
      nodeVersion: '22',
      gen: 2,
      httpsOptions: {
        region: 'asia-northeast3',
      },
    },
    preset: 'firebase',
  },
  i18n: {
    langDir: 'locales',
    lazy: true,
    locales: [
      { code: 'en', file: 'en.json', name: 'English' },
      { code: 'ko', file: 'ko.json', name: '한국어' },
    ],
    defaultLocale: 'ko',
  },
  //firebase
  runtimeConfig: {
    public: {
      firebaseApiKey: process.env.NUXT_FIREBASE_API_KEY,
      firebaseAuthDomain: process.env.NUXT_FIREBASE_AUTH_DOMAIN,
      firebaseProjectId: process.env.NUXT_FIREBASE_PROJECT_ID,
      firebaseStorageBucket: process.env.NUXT_FIREBASE_STORAGE_BUCKET,
      firebaseMessagingSenderId: process.env.NUXT_FIREBASE_MESSAGING_SENDER_ID,
      firebaseAppId: process.env.NUXT_FIREBASE_APP_ID,
      //
      firebaseFunctionBase:
        'https://asia-northeast3-manoscreative-30cf3.cloudfunctions.net',
    },
  },
});
