Files
lingji-work-fe/vite.config.ts
林志军 7e7a4f363b refactor(agent): 重构智能对话页面布局和样式
- 重新设计了页面布局,分为左、右两个主要区域
- 左侧区域增加了聊天机器人信息展示,包括头像、名称、描述等
- 右侧区域保留聊天窗口,并增加了顶部栏
-优化了响应式布局,使页面在不同屏幕尺寸下都能良好显示
- 调整了颜色、字体等样式,提升了页面视觉效果
2025-07-31 14:36:45 +08:00

67 lines
1.6 KiB
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.

/*
* @Author: RenXiaoDong
* @Date: 2025-07-02 09:17:39
*/
import type { ConfigEnv, UserConfig } from 'vite';
import { defineConfig, loadEnv } from 'vite';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import analyzer from 'rollup-plugin-visualizer';
import { pluginsConfig, setServerConfig, resolve } from './config';
export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
const envDir = resolve('env');
const env = loadEnv(mode, envDir, '');
const setServer = setServerConfig({ env });
return {
css: {
preprocessorOptions: {
scss: {
additionalData: `@import "@/styles/lib/variable.scss"; @import "@/styles/mixins/index.scss";`,
},
},
},
plugins: [vue(), vueJsx(), ...pluginsConfig, setAnalyzer(env.VITE_ENV)],
resolve: {
extensions: ['.jsx', '.tsx', '.js', '.ts', '.json', '.vue'],
alias: {
'@': resolve('src'),
'@components': resolve('src/components'),
},
},
envDir,
envPrefix: env.ENV_PREFIX,
server: {
proxy: {
'/api': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
// 目标地址
target: 'http://www.lingji.com/api',
// target: 'http://192.168.40.22/api',
},
},
},
preview: setServer(),
};
});
/**
* 设置分析器仅在development环境下生效
* @param env
* @returns
*/
function setAnalyzer(env = 'development') {
console.log('env: ', env);
if (env === 'development') {
return analyzer({
filename: 'analyzer.html',
open: true,
});
}
return null;
}