fix(frontend): keep custom theme tokens in production builds

Raise theme.css selector specificity so TDesign bundled styles cannot
override WeKnora tokens after minification, and add vite preview proxy
so production-like local testing can reach the API backend.
This commit is contained in:
wizardchen
2026-07-21 20:28:00 +08:00
committed by lyingbug
parent 0d545c8c6a
commit be48324c84
2 changed files with 21 additions and 2 deletions
File diff suppressed because one or more lines are too long
+19
View File
@@ -143,5 +143,24 @@ export default defineConfig({
secure: false,
}
}
},
// `vite preview` 用生产构建产物(dist)本地起服务,是最接近 release 镜像的环境:
// 同样的压缩 / 拆包 / CSS 加载顺序,可提前暴露只在生产构建出现的问题
// (如主题变量被打包顺序覆盖)。用法:npm run build && npm run preview
preview: {
port: 4173,
host: true,
proxy: {
'/api': {
target: DEV_PROXY_TARGET,
changeOrigin: true,
secure: false,
},
'/files': {
target: DEV_PROXY_TARGET,
changeOrigin: true,
secure: false,
}
}
}
})