import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; const currentDir = dirname(fileURLToPath(import.meta.url)); export default defineNuxtConfig({ devtools: { enabled: true }, modules: [ '@nuxtjs/tailwindcss', 'shadcn-nuxt', '@vueuse/nuxt', '@nuxt/content', '@nuxt/image', '@nuxt/icon', '@nuxtjs/color-mode', 'nuxt-og-image', '@nuxt/scripts', '@nuxtjs/i18n', ], shadcn: { prefix: 'Ui', componentDir: join(currentDir, './components/ui'), }, components: { global: true, dirs: [ { path: './components', ignore: ['**/*.ts'], }, ], }, colorMode: { classSuffix: '', disableTransition: true, }, css: [ join(currentDir, './assets/css/themes.css'), ], tailwindcss: { config: { content: [ join(currentDir, './pages/**/*.{vue,js,ts}'), join(currentDir, './components/**/*.{vue,js,ts}'), ], }, }, icon: { clientBundle: { scan: true, sizeLimitKb: 512, }, }, typescript: { tsConfig: { compilerOptions: { baseUrl: '.', }, }, }, build: { transpile: ['shiki', 'ohash'], }, compatibilityDate: '2024-07-05', i18n: { locales: [ { code: 'en', name: 'English', language: 'en-US', dir: 'ltr' }, { code: 'zh', name: '简体中文', language: 'zh-CN', dir: 'ltr' }, ], strategy: 'prefix', defaultLocale: 'en', detectBrowserLanguage: { useCookie: true, cookieKey: 'i18n_redirected', redirectOn: 'root', // recommended }, }, });