From f1c3131872fc49e58db3e7ef6bbc0ba124f9d93c Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Sat, 21 Jun 2025 11:04:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/test' into test
---
vite.config.mjs | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/vite.config.mjs b/vite.config.mjs
index cbcf19c..a80022b 100644
--- a/vite.config.mjs
+++ b/vite.config.mjs
@@ -1,20 +1,20 @@
-import { defineConfig, loadEnv } from 'vite';
-import { resolve } from 'path';
-import createVitePlugins from './vite/plugins';
+import { defineConfig, loadEnv } from 'vite'
+import { resolve } from 'path'
+import createVitePlugins from './vite/plugins'
import postCssPxToRem from 'postcss-pxtorem'
// https://vitejs.dev/config/
export default ({ mode, command }) => {
- const env = loadEnv(mode, process.cwd());
- const { VITE_APP_ENV, VITE_APP_BASE, VITE_APP_URL } = env;
+ const env = loadEnv(mode, process.cwd())
+ const { VITE_APP_ENV, VITE_APP_BASE, VITE_APP_URL } = env
// 判断是打生产环境包
- const isProd = VITE_APP_ENV === 'production';
+ const isProd = VITE_APP_ENV === 'production'
// 根据是否生产环境,动态设置压缩配置
const buildConfig = {
outDir: 'manage',
target: 'esnext',
minify: isProd ? 'terser' : 'esbuild', // 根据环境选择压缩工具
- };
+ }
// 如果是生产环境,添加Terser的配置
if (isProd) {
@@ -26,7 +26,7 @@
format: {
comments: false, // 删除所有注释
},
- };
+ }
}
return defineConfig({
base: VITE_APP_BASE,
@@ -36,14 +36,14 @@
__INTLIFY_PROD_DEVTOOLS__: false,
},
server: {
- // port: 2888,
+ port: 5174,
// host: '192.168.1.178',
proxy: {
'/api': {
target: VITE_APP_URL,
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ''),
- },
+ }
},
},
resolve: {
@@ -77,5 +77,5 @@
target: 'esnext',
},
},
- });
-};
+ })
+}
--
Gitblit v1.9.3