563909fafa
- 新增全局弹窗表单标准类 .dialog-form--carded,实现卡片白底分组风格 - 规范表单标签宽度为 calc(6em + 24px),右对齐且垂直居中 - 统一 input/select/cascader/tree-select/date-editor/textarea 等控件宽度为 250px - 保持 radio/checkbox 组宽度自适应 - 应用样式改造多个弹窗组件:流程变更、流程删除、参数编辑、锁定用户、解锁确认、用户编辑与修改密码、新建导入 - 港口码头编辑弹窗内 input 宽度统一为 250px,调整详细地址为单行输入框并放宽宽度 - 调整备注字段文本域高度,优化整体弹窗表单布局与风格统一
99 lines
2.3 KiB
JavaScript
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',
|
|
},
|
|
},
|
|
});
|
|
};
|