Files
Nexus/frontend/vite.config.mts
T
Your Name e084d90c61 fix: add Bing wallpaper proxy endpoint, make it public (no JWT required)
- Added GET /api/settings/bing-wallpaper — proxies cn.bing.com HPImageArchive
  to avoid CORS issues, returns {url} for the daily wallpaper
- Added /api/settings/bing-wallpaper to PUBLIC_PREFIXES in auth_jwt.py
  so the login page can fetch it without authentication
- Login page now fetches wallpaper via backend proxy instead of direct CORS-blocked fetch

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 20:12:09 +08:00

59 lines
1.4 KiB
TypeScript

import { fileURLToPath, URL } from 'node:url'
import Vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
Vue({
template: { transformAssetUrls },
}),
Vuetify({
autoImport: true,
styles: {
configFile: 'src/styles/settings.scss',
},
}),
],
define: { 'process.env': {} },
resolve: {
alias: {
'@': fileURLToPath(new URL('src', import.meta.url)),
},
extensions: [
'.js',
'.json',
'.jsx',
'.mjs',
'.ts',
'.tsx',
'.vue',
],
},
// Production build: output directly to web/app/ so the backend's StaticFiles
// mount at /app/ serves the SPA without a copy step.
// Old HTML pages (login.html etc.) coexist but are no longer the primary entry.
base: '/app/',
build: {
outDir: fileURLToPath(new URL('../web/app', import.meta.url)),
emptyOutDir: false, // Don't delete old HTML pages still in git
},
server: {
port: 3000,
proxy: {
'/api': {
target: 'https://api.synaglobal.vip',
changeOrigin: true,
secure: true,
},
'/ws': {
target: 'wss://api.synaglobal.vip',
ws: true,
changeOrigin: true,
secure: true,
},
},
},
})