// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  devtools: { enabled: true },

  runtimeConfig: {
    public: {
      API_BASE: 'https://service1.fenshenzhike.com/',
    },
  },

  modules: [
    '@nuxt/ui',
    'radix-vue/nuxt',
    'dayjs-nuxt',
    '@pinia/nuxt',
    '@pinia-plugin-persistedstate/nuxt',
    '@vite-pwa/nuxt',
    '@nuxtjs/google-fonts',
    '@nuxt/image',
    '@vueuse/nuxt',
    'nuxt-driver.js',
  ],

  routeRules: {
    '/': {
      redirect: {
        to: '/generation',
        statusCode: 302,
      },
    },
  },

  icon: {
    provider: 'iconify',
    serverBundle: false,
  },

  colorMode: {
    preference: 'light',
  },

  dayjs: {
    locales: ['zh', 'en'],
    plugins: ['relativeTime', 'utc', 'timezone', 'duration'],
    defaultLocale: 'zh',
    defaultTimezone: 'Asia/Shanghai',
  },

  googleFonts: {
    display: 'swap',
    families: {
      Rubik: '100..900',
      'Noto Sans SC': '100..900',
      'Barlow Condensed': '100..900',
    },
  },

  compatibilityDate: '2024-07-28',
})