Files
cz-web/vite.config.ts
wangzzpeng 7bc84bbe5e first
2026-09-24 10:10:43 +08:00

33 lines
832 B
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 vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
server: {
proxy: {
// 开发期把 /api 转发到 vermis-maker 后端(8080),并去掉 /api 前缀
'/api': {
target: 'http://localhost:8080',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
css: {
preprocessorOptions: {
less: {
// 自动注入变量与混合宏,组件内可直接使用 @primary-color 等
additionalData: '@import "@/styles/variables.less";\n@import "@/styles/mixins.less";',
},
},
},
})