// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  devtools: { enabled: true },
  runtimeConfig: {
    public: {
      apiBaseUrl: process.env.NUXT_API_BASE_URL,
    },
    private: {
      apiBaseUrl: process.env.NUXT_API_INNER_URL,
    }
  },
  app: {
    baseURL: '/home/',
    head: {
      link: [
        {
          rel: 'stylesheet',
          href: '/home/js/libs/bootstrap/bootstrap-submenu.min.css'
        },
        {
          rel: 'stylesheet',
          href: 'https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.css'
        }
      ],
      script: [
        {
          src: '/home/js/libs/jquery/jquery-3.7.0.min.js'
        },
        {
          src: '/home/js/libs/bootstrap/bootstrap.bundle.min.js'
        },
        {
          src: '/home/js/libs/bootstrap/bootstrap-submenu.js'
        },
        {
          src: '/home/js/libs/swiper/swiper-bundle.min.js'
        },
        {
          src: '/home/js/libs/fontawesome/all.min.js'
        },
        {
          src: '/home/js/main.js'
        },
        {
          src: 'https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.umd.js'
        }
      ],
    }
  },
  css: ['@/assets/css/main.css','@/assets/css/ckeditor.css'],
  build: {
    loaders: {
      less: {
        javascriptEnabled: true
      }
    }
  },
  modules: [
    '@nuxtjs/i18n',
    '@pinia/nuxt',
    '@element-plus/nuxt',
  ],
  i18n: {
    // strategy: 'prefix',
    langDir: 'locales',
    locales: [
      {
        code: 'tw',
        iso: 'zh-TW',
        file: 'tw.js'
      },
      {
        code: 'cn',
        iso: 'zh-CN',
        file: 'cn.js'
      },
      {
        code: 'en',
        iso: 'en-US',
        file: 'en.js'
      }
    ],
    defaultLocale: 'tw',
    detectBrowserLanguage: {
      useCookie: true,
      cookieKey: 'i18n_redirected',
      redirectOn: 'root'
    }
  }  
})
