Files
admin/www/nuxt.config.ts
T
2026-08-04 19:18:35 +08:00

52 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export default defineNuxtConfig({
// SPA 模式渲染,预留 SSR/SSG 升级能力
ssr: false,
modules: ['@unocss/nuxt', '@nuxtjs/i18n', '@pinia/nuxt', '@vueuse/nuxt'],
css: ['~/assets/css/main.css'],
// 运行时配置:NUXT_PUBLIC_API_BASE_URL / NUXT_PUBLIC_ASSET_BASE_URL 环境变量可覆盖
runtimeConfig: {
public: {
apiBaseUrl: 'http://localhost:8083/api',
// 素材静态服务地址(用于解析 /uploads/... 相对路径),为空时默认取 apiBaseUrl 的 origin
assetBaseUrl: ''
}
},
// 国际化:中文默认无前缀,英文 /en 前缀
// v10:显式指定 locale 文件(相对于 i18n/ 目录的 langDir
i18n: {
locales: [
{ code: 'zh', language: 'zh-CN', name: '中文', file: 'zh.json' },
{ code: 'en', language: 'en-US', name: 'English', file: 'en.json' }
],
langDir: 'locales',
defaultLocale: 'zh',
// SEO 标签(canonical / hreflang)所需的站点基础 URL,部署时通过环境变量配置
baseUrl: process.env.NUXT_PUBLIC_SITE_URL || 'http://localhost:3100',
strategy: 'prefix_except_default',
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'i18n_redirected',
redirectOn: 'root'
}
},
app: {
head: {
title: '乐笙 Luxsin',
meta: [{ name: 'description', content: '乐笙(Luxsin)产品官网' }]
}
},
devServer: {
port: 3100
},
telemetry: false,
compatibilityDate: '2026-07-29'
});