Files
admin/www/nuxt.config.ts
T

52 lines
1.5 KiB
TypeScript
Raw Normal View History

export default defineNuxtConfig({
// SPA 模式渲染,预留 SSR/SSG 升级能力
ssr: false,
modules: ['@unocss/nuxt', '@nuxtjs/i18n', '@pinia/nuxt', '@vueuse/nuxt'],
2026-07-31 19:02:00 +08:00
css: ['~/assets/css/main.css'],
2026-08-04 19:18:35 +08:00
// 运行时配置:NUXT_PUBLIC_API_BASE_URL / NUXT_PUBLIC_ASSET_BASE_URL 环境变量可覆盖
2026-07-31 19:02:00 +08:00
runtimeConfig: {
public: {
2026-08-04 19:18:35 +08:00
apiBaseUrl: 'http://localhost:8083/api',
// 素材静态服务地址(用于解析 /uploads/... 相对路径),为空时默认取 apiBaseUrl 的 origin
assetBaseUrl: ''
2026-07-31 19:02:00 +08:00
}
},
// 国际化:中文默认无前缀,英文 /en 前缀
2026-07-31 19:02:00 +08:00
// v10:显式指定 locale 文件(相对于 i18n/ 目录的 langDir
i18n: {
locales: [
2026-07-31 19:02:00 +08:00
{ code: 'zh', language: 'zh-CN', name: '中文', file: 'zh.json' },
{ code: 'en', language: 'en-US', name: 'English', file: 'en.json' }
],
2026-07-31 19:02:00 +08:00
langDir: 'locales',
defaultLocale: 'zh',
2026-07-31 19:02:00 +08:00
// 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'
});