2025-07-12 07:09:18 +08:00
|
|
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
|
|
|
|
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
|
|
|
|
|
|
import Components from 'unplugin-vue-components/vite'
|
|
|
|
|
|
|
2025-07-10 01:27:35 +08:00
|
|
|
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
|
|
|
|
export default defineNuxtConfig({
|
|
|
|
|
|
devtools: { enabled: true },
|
2025-07-12 07:09:18 +08:00
|
|
|
|
vite: {
|
2025-07-19 11:53:37 +08:00
|
|
|
|
clearScreen: false,
|
2025-07-12 07:09:18 +08:00
|
|
|
|
plugins: [
|
|
|
|
|
|
AutoImport({
|
|
|
|
|
|
imports: [
|
|
|
|
|
|
{
|
|
|
|
|
|
'naive-ui': [
|
|
|
|
|
|
'useDialog',
|
|
|
|
|
|
'useMessage',
|
|
|
|
|
|
'useNotification',
|
|
|
|
|
|
'useLoadingBar'
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}),
|
|
|
|
|
|
Components({
|
|
|
|
|
|
resolvers: [NaiveUiResolver()]
|
|
|
|
|
|
})
|
|
|
|
|
|
],
|
|
|
|
|
|
optimizeDeps: {
|
2025-07-24 18:45:32 +08:00
|
|
|
|
include: ['vueuc', 'date-fns'],
|
2025-07-19 08:55:07 +08:00
|
|
|
|
exclude: ["oxc-parser"] // 强制使用 WASM 版本
|
2025-08-18 09:41:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
server: {
|
|
|
|
|
|
proxy: {
|
2025-08-18 19:40:10 +08:00
|
|
|
|
'/api': {
|
|
|
|
|
|
target: 'http://localhost:8080',
|
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
|
secure: false,
|
|
|
|
|
|
rewrite: (path) => path
|
|
|
|
|
|
},
|
2025-08-18 09:41:19 +08:00
|
|
|
|
'/uploads': {
|
|
|
|
|
|
target: 'http://localhost:8080',
|
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
|
secure: false,
|
|
|
|
|
|
rewrite: (path) => path
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-12 07:09:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
modules: ['@nuxtjs/tailwindcss', '@pinia/nuxt'],
|
2025-07-10 01:27:35 +08:00
|
|
|
|
css: [
|
|
|
|
|
|
'~/assets/css/main.css',
|
|
|
|
|
|
'vfonts/Lato.css',
|
|
|
|
|
|
'vfonts/FiraCode.css',
|
2025-07-11 18:37:28 +08:00
|
|
|
|
'@fortawesome/fontawesome-free/css/all.min.css', // 本地Font Awesome
|
2025-07-10 01:27:35 +08:00
|
|
|
|
],
|
|
|
|
|
|
app: {
|
|
|
|
|
|
head: {
|
2025-07-21 00:43:07 +08:00
|
|
|
|
title: '老九网盘资源数据库',
|
2025-11-12 00:57:41 +08:00
|
|
|
|
htmlAttrs: {
|
|
|
|
|
|
lang: 'zh-CN'
|
|
|
|
|
|
},
|
2025-07-10 01:27:35 +08:00
|
|
|
|
meta: [
|
|
|
|
|
|
{ charset: 'utf-8' },
|
|
|
|
|
|
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
2025-11-12 00:57:41 +08:00
|
|
|
|
{ name: 'description', content: '老九网盘资源管理数据庫,现代化的网盘资源数据库,支持多网盘自动化转存分享,支持百度网盘,阿里云盘,夸克网盘, 天翼云盘,迅雷云盘,123云盘,115网盘,UC网盘' },
|
|
|
|
|
|
{ name: 'robots', content: 'index, follow' },
|
|
|
|
|
|
{ name: 'theme-color', content: '#3b82f6' },
|
|
|
|
|
|
{ property: 'og:site_name', content: '老九网盘资源数据库' },
|
|
|
|
|
|
{ property: 'og:type', content: 'website' },
|
|
|
|
|
|
{ name: 'twitter:card', content: 'summary_large_image' }
|
2025-07-10 01:27:35 +08:00
|
|
|
|
],
|
|
|
|
|
|
link: [
|
2025-11-12 00:57:41 +08:00
|
|
|
|
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
|
|
|
|
|
|
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
|
|
|
|
|
|
{ rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: 'anonymous' }
|
2025-07-10 01:27:35 +08:00
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
runtimeConfig: {
|
|
|
|
|
|
public: {
|
2025-08-19 01:11:09 +08:00
|
|
|
|
// 客户端API地址:开发环境通过代理,生产环境通过Nginx
|
|
|
|
|
|
apiBase: '/api',
|
|
|
|
|
|
// 服务端API地址:通过环境变量配置,支持不同部署方式
|
2025-11-12 00:57:41 +08:00
|
|
|
|
apiServer: process.env.NUXT_PUBLIC_API_SERVER || (process.env.NODE_ENV === 'production' ? 'http://backend:8080/api' : '/api'),
|
|
|
|
|
|
// OG图片服务API地址(集成到主服务中)
|
|
|
|
|
|
ogApiUrl: process.env.NUXT_PUBLIC_OG_API_URL || (process.env.NODE_ENV === 'production' ? '/api/og-image' : '/api/og-image')
|
2025-07-10 01:27:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
build: {
|
|
|
|
|
|
transpile: ['naive-ui', 'vueuc', '@css-render/vue3-ssr', '@juggle/resize-observer']
|
2025-07-10 13:58:28 +08:00
|
|
|
|
},
|
|
|
|
|
|
ssr: true,
|
|
|
|
|
|
nitro: {
|
2025-08-14 09:46:13 +08:00
|
|
|
|
logLevel: 'info',
|
|
|
|
|
|
preset: 'node-server',
|
|
|
|
|
|
storage: {
|
|
|
|
|
|
redis: {
|
|
|
|
|
|
driver: 'memory',
|
|
|
|
|
|
max: 1000
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-10 01:27:35 +08:00
|
|
|
|
}
|
2025-07-12 07:09:18 +08:00
|
|
|
|
})
|