shengqingqixie-admin/vite.config.js
榆钱落尽槿花稀 d6012c7cf4 1.入会流程字段同步
2.入会表单验证
3.国家数据接口对接
4.入会表单提交接口对接,问题处理
5.回显查询详情接口对接,问题处理
2025-04-21 18:08:16 +08:00

60 lines
1.2 KiB
JavaScript
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 { loadEnv } from 'vite';
import { viteMockServe } from 'vite-plugin-mock';
import { createVuePlugin } from 'vite-plugin-vue2';
import { createSvgPlugin } from 'vite-plugin-vue2-svg';
import path from 'path';
const CWD = process.cwd();
export default ({ mode }) => {
const { VITE_BASE_URL } = loadEnv(mode, CWD);
return {
base: VITE_BASE_URL,
resolve: {
alias: {
'~': path.resolve(__dirname, './'),
'@': path.resolve(__dirname, './src'),
},
},
css: {
preprocessorOptions: {
less: {
modifyVars: {},
},
},
},
plugins: [
createVuePlugin({
jsx: true,
}),
viteMockServe({
mockPath: 'mock',
localEnabled: true,
}),
createSvgPlugin(),
],
build: {
cssCodeSplit: false,
},
server: {
proxy: {
'/api': {
// 用于开发环境下的转发请求
// 更多请参考https://vitejs.dev/config/#server-proxy
target: 'http://192.168.10.140/',
pathRewrite: {
'^/api': ''
},
changeOrigin: true,
},
},
},
};
};