// https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ compatibilityDate: '2025-07-15', devtools: { enabled: true }, app: { // head head: { title: '金申机械制造有限公司', meta: [ { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { name: 'description', content: 'Jinshen Website', }, ], link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }], }, }, runtimeConfig: { public: { meili: { host: process.env.MEILI_HOST || 'http://localhost:7700', searchKey: process.env.MEILI_SEARCH_KEY || '', indexes: process.env.MEILI_SEARCH_INDEXES ? typeof process.env.MEILI_SEARCH_INDEXES === 'string' ? process.env.MEILI_SEARCH_INDEXES.split(',').map((i) => i.trim()) : process.env.MEILI_SEARCH_INDEXES : ['products', 'solutions', 'questions', 'product_documents'], }, strapi: { url: process.env.STRAPI_URL || 'http://localhost:1337', token: process.env.STRAPI_TOKEN || undefined, prefix: '/api', admin: '/admin', version: 'v5', cookie: {}, cookieName: 'strapi_jwt', }, directus: { url: process.env.DIRECTUS_URL || 'http://localhost:8055', token: process.env.DIRECTUS_TOKEN || undefined, }, }, }, fonts: { provider: 'local', }, typescript: { tsConfig: { compilerOptions: { noUnusedLocals: false, noUnusedParameters: false, strict: false, }, }, }, // css css: [ '@unocss/reset/tailwind.css', '~/assets/scss/index.scss', '~/assets/css/fonts.css', '@mdi/font/css/materialdesignicons.min.css', ], nitro: { esbuild: { options: { target: 'esnext', }, }, // prerender: { // crawlLinks: false, // routes: ['/'], // ignore: ['/hi'], // }, }, vite: { css: { preprocessorOptions: { scss: { additionalData: `@use "@/assets/scss/element/index.scss" as element;`, }, }, }, }, devServer: { port: 3000, host: '0.0.0.0', }, elementPlus: { icon: 'ElIcon', importStyle: 'scss', themes: ['dark'], }, i18n: { detectBrowserLanguage: { useCookie: true, cookieKey: 'i18n_redirected', redirectOn: 'root', alwaysRedirect: true, }, locales: [ { code: 'en', language: 'en-US', name: 'English', file: 'en.json' }, { code: 'zh', language: 'zh-CN', name: '简体中文', file: 'zh.json' }, ], defaultLocale: 'zh', strategy: 'prefix_except_default', langDir: 'locales', }, imports: { dirs: ['types/**', 'models/**'], }, modules: [ '@nuxt/eslint', '@nuxt/fonts', '@nuxt/icon', '@nuxt/image', '@nuxt/test-utils', '@vueuse/nuxt', '@pinia/nuxt', '@unocss/nuxt', '@element-plus/nuxt', '@nuxtjs/i18n', '@nuxtjs/strapi', ], });