从小熊那拷贝一份

This commit is contained in:
2026-09-14 09:10:16 +08:00
commit 95e46314e5
24 changed files with 3989 additions and 0 deletions

38
vite.config.ts Normal file
View File

@@ -0,0 +1,38 @@
import { defineConfig, loadEnv } from 'vite'
import { resolve } from 'node:path'
import vue from '@vitejs/plugin-vue'
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const target = env.SUB2API_BASE_URL || 'https://sub2api.example.com'
const adminKey = env.ADMIN_API_KEY || env.VITE_ADMIN_API_KEY || ''
return {
plugins: [vue()],
build: {
rollupOptions: {
input: {
list: resolve(__dirname, 'list.html'),
groups: resolve(__dirname, 'groups.html'),
},
},
},
server: {
host: true,
port: 5176,
strictPort: true,
proxy: {
'/api': {
target,
changeOrigin: true,
secure: true,
configure(proxy) {
proxy.on('proxyReq', (proxyReq) => {
if (adminKey) proxyReq.setHeader('x-api-key', adminKey)
})
},
},
},
},
}
})