feat: R1 重构对称迁移 + 升级依赖 + 配置文件分离
- 命名重构:tenant → customer(对齐后端 R1 重构) - Tenant → Customer / tenant_id → customerId - tenantStore → customerStore / getTenant/setTenant → getCustomer/setCustomer - cookie key tenant → customer, HTTP header tenantId → customerId - 后端契约更新:AuthResponse 加 sub 字段 - 接口 URL 修复:/auth/oidc/callback → /api/v1/auth/oidc/callback - 依赖升级:vue 3.5 / element-plus 2.8 / vite 5 / typescript 5.6 / sass 1.79 - 删 node-sass / scss / sass-loader / moment / mock/index.ts - 配置文件拆分:.env.development / .env.production / .env.example - 删除冗余 view/auth/auth/callback.vue 副本 - .gitignore 增加 dist / .opencode / tmp - 新增 AGENT.md 与后端风格对齐
This commit is contained in:
+21
-14
@@ -2,37 +2,44 @@ import { defineConfig, loadEnv } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import viteCompression from 'vite-plugin-compression'
|
||||
import { viteMockServe } from 'vite-plugin-mock'
|
||||
import { resolve } from 'path'
|
||||
import { fileURLToPath, URL } from 'url'
|
||||
|
||||
// https://vitejs.cn/guide/env-and-mode.html#env-files
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, __dirname)
|
||||
// https://vitejs.dev/guide/env-and-mode.html#env-files
|
||||
export default defineConfig(({ mode, command }) => {
|
||||
const env = loadEnv(mode, process.cwd())
|
||||
return {
|
||||
plugins: [
|
||||
vue(),
|
||||
// this is a gzip plugin to generate the .js.gz file
|
||||
// gzip 压缩
|
||||
viteCompression(),
|
||||
// 本地 mock 服务(仅 dev 启用,prod 不引入)
|
||||
viteMockServe({
|
||||
mockPath: 'mock',
|
||||
localEnabled: true,
|
||||
localEnabled: command === 'serve',
|
||||
}),
|
||||
],
|
||||
pluginOptions: {
|
||||
'style-resources-loader': {
|
||||
preProcessor: 'scss',
|
||||
patterns: []
|
||||
}
|
||||
},
|
||||
base: env.VITE_RES_URL,
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve(__dirname, 'src')
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
}
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
additionalData: `@import "@/style/mixin.scss";`
|
||||
additionalData: `@use "@/style/mixin.scss" as *;`
|
||||
}
|
||||
}
|
||||
},
|
||||
build: {
|
||||
// 拆 chunk,减少首屏加载
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
'vendor-vue': ['vue', 'vue-router', 'pinia'],
|
||||
'vendor-ui': ['element-plus', '@element-plus/icons-vue'],
|
||||
'vendor-chart': ['echarts'],
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user