Files
tms-erp-web/vite.config.mjs
T
gxwebsoft 4199255186 style(business): 统一优化多个业务弹窗为接近全屏高度
- /business/waybill-manage 新增/编辑弹窗添加 dialogCustomClass 控制高度样式,覆盖默认 max-height 限制
- /business/contract-manage 弹窗同样加 dialogCustomClass,scoped 样式解开 Avue 弹窗默认 body 高度限制并实现底部操作栏粘性
- element-ui.scss 新增对应页 dialog 样式,确保弹窗上下留白20px,内容区高度自动适应,底部操作栏始终可见
- 复用 business-crud-page 组件中传入 option 的 dialogCustomClass 实现页面隔离样式,不影响其他业务弹窗
- loading-manage.vue 调整路线展示类型样式,分别对应起点、中间、终点三种状态,增加状态背景色区分
- .workbuddy/memory.md 补充业务弹窗高度改法说明,强调利用 dialogCustomClass 实现弹窗样式定制与复用机制
2026-08-14 16:01:32 +08:00

99 lines
2.3 KiB
JavaScript

import {
defineConfig,
loadEnv
} from 'vite';
import { resolve } from 'path'
import createVitePlugins from './vite/plugins';
// https://vitejs.dev/config/
export default ({
mode,
command
}) => {
const env = loadEnv(mode, process.cwd())
const {
VITE_APP_ENV,
VITE_APP_BASE
} = env
// 判断是打生产环境包
const isProd = VITE_APP_ENV === 'production'
// 根据是否生产环境,动态设置压缩配置
const buildConfig = {
target: 'esnext',
minify: isProd ? 'terser' : 'esbuild', // 根据环境选择压缩工具
};
// 如果是生产环境,添加Terser的配置
if (isProd) {
buildConfig.terserOptions = {
compress: {
drop_console: true, // 删除 console
drop_debugger: true, // 删除 debugger
},
format: {
comments: false // 删除所有注释
}
};
buildConfig.rollupOptions = {
output: {
manualChunks: {
'element-plus': ['element-plus'],
'@smallwei/avue': ['@smallwei/avue']
},
}
}
}
return defineConfig({
base: VITE_APP_BASE,
define: {
__VUE_I18N_FULL_INSTALL__: true,
__VUE_I18N_LEGACY_API__: true,
__INTLIFY_PROD_DEVTOOLS__: false,
},
server: {
port: 2888,
proxy: {
'/api': {
target: 'http://localhost',
//target: 'https://saber3.bladex.cn/api',
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ''),
},
},
},
// server: {
// port: 2889,
// proxy: {
// '/api': {
// target: 'http://172.16.203.228:8000',
// changeOrigin: true,
// },
// },
// },
resolve: {
alias: {
'~': resolve(__dirname, './'),
'@': resolve(__dirname, './src'),
components: resolve(__dirname, './src/components'),
styles: resolve(__dirname, './src/styles'),
utils: resolve(__dirname, './src/utils'),
},
},
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
additionalData: `@use "@/styles/variables.scss" as *;`,
},
},
},
plugins: createVitePlugins(env, command === 'build'),
build: buildConfig,
optimizeDeps: {
esbuildOptions: {
target: 'esnext',
},
},
});
};