Files
cz-web/vite.config.ts
2026-10-08 10:16:13 +08:00

35 lines
861 B
TypeScript
Raw 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: {
host: true,
proxy: {
// 开发期把 /api 转发到 vermis-maker 后端(8080),并去掉 /api 前缀
'/api': {
target: 'http://192.168.0.43: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";',
},
},
},
})