Files
wangairnan 87d9bab5dc feat(web): 整体替换 UI 框架为 Ant Design 6 并接入自定义主题
以 antd ConfigProvider + antd-style 承载 zinc 风格自定义主题(明暗双套 token),
button/input/select/notification 用 createStyles 定制;三态主题经
darkAlgorithm 无刷新切换;use-toast 改基于 antd notification;
移除 shadcn/ui 组件目录与 radix 依赖;样式桥接层保证排版与多端布局不变。
2026-09-09 10:35:24 +08:00

37 lines
1.3 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
// https://vite.dev/config/
export default defineConfig({
// base 必须为默认 '/':相对 base 在 /notes/:slug 深链下会把资源解析到
// /notes/assets/… 导致白屏(设计 §8.3-2,禁止修改)
base: '/',
plugins: [react(), tailwindcss()],
resolve: {
// shadcn 组件别名的运行时解析(components.json aliases)
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
proxy: {
// 同源是 Cookie/CSRF 成立的前提(§10.5)
// changeOrigin:false —— 保留浏览器原始 Host(localhost:5173),
// 否则后端 Origin 校验会因 Host 被改写为 127.0.0.1:8080 而判定跨源 403。
'/api': {
target: 'http://127.0.0.1:8080',
changeOrigin: false,
},
},
},
build: {
// 产物内容 hash 文件名(§8.3-5)
assetsDir: 'assets',
// 不做手动 codeSplitting 分组:分组 chunk 会被提升进入口静态依赖,
// HTML 对其发出 modulepreload,导致 lazy() 路由的 CodeMirror 在
// 所有页面被预加载(Lighthouse unused-javascript 549KiB 的根因)。
},
})