From 548dcb58164aaeb7ec8a4f3425953bcd25d83c65 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 15 Jan 2025 18:40:00 +0800
Subject: [PATCH] 应急空间位置更新
---
vite.config.js | 61 +++++++++++++++++++++++++++---
1 files changed, 55 insertions(+), 6 deletions(-)
diff --git a/vite.config.js b/vite.config.js
index 5af17bd..5a980ec 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -2,7 +2,7 @@
* @Author: shuishen 1109946754@qq.com
* @Date: 2024-10-25 10:56:27
* @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-10-29 21:44:48
+ * @LastEditTime: 2024-12-17 12:07:31
* @FilePath: \bigScreen\vite.config.js
* @Description:
*
@@ -15,6 +15,9 @@
import AutoImport from 'unplugin-auto-import/vite'
import basicSsl from '@vitejs/plugin-basic-ssl'
+import { fa } from 'element-plus/es/locales.mjs'
+import viteCompression from 'vite-plugin-compression'
+// import vueDevTools from 'vite-plugin-vue-devtools'
export default ({ mode, command }) => {
const env = loadEnv(mode, process.cwd())
@@ -24,7 +27,7 @@
// 根据是否生产环境,动态设置压缩配置
const buildConfig = {
- outDir: 'manage',
+ outDir: 'zhyq',
target: 'esnext',
minify: isProd ? 'terser' : 'esbuild', // 根据环境选择压缩工具
}
@@ -52,7 +55,15 @@
basicSsl(),
AutoImport({
imports: ["vue", "vue-router"], // 自动导入vue和vue-router相关函数
- })
+ }),
+ viteCompression({
+ filter: /\.(js|css|json|txt|ico|svg)(\?.*)?$/i, // 需要压缩的文件
+ threshold: 1024, // 文件容量大于这个值进行压缩
+ algorithm: 'gzip', // 压缩方式
+ ext: 'gz', // 后缀名
+ deleteOriginFile: false, // 压缩后是否删除压缩源文件
+ }),
+ // vueDevTools()
],
css: {
@@ -80,12 +91,50 @@
port: 668,
https: true,
host: '0.0.0.0',
+ // hmr:{
+ // overlay:false
+ // },
proxy: {
- '/api': {
+ '/xinganTileset': {
// target: 'http://localhost',
- target: 'https://wrj.shuixiongit.com/api',
+ target: 'http://182.109.88.42:10010/xinganTileset',
changeOrigin: true,
- rewrite: path => path.replace(/^\/api/, ''),
+ rewrite: path => path.replace(/^\/xinganTileset/, ''),
+ },
+
+ '/zhyq3Dtile': {
+ // target: 'http://localhost',
+ target: 'https://wrj.shuixiongit.com/zhyq3Dtile',
+ changeOrigin: true,
+ rewrite: path => path.replace(/^\/zhyq3Dtile/, ''),
+ },
+
+ '/panorama': {
+ // target: 'http://localhost',
+ target: 'http://vr.jxpskj.com:180',
+ changeOrigin: true,
+ rewrite: path => path.replace(/^\/panorama/, ''),
+ },
+
+ '/zhyq-xg/newMx': {
+ // target: 'http://localhost',
+ target: 'https://wrj.shuixiongit.com/zhyq-xg/newMx',
+ changeOrigin: true,
+ rewrite: path => path.replace(/^\/zhyq-xg\/newMx/, ''),
+ },
+
+ // '/zhyq-xg/mx': {
+ // // target: 'http://localhost',
+ // target: 'https://wrj.shuixiongit.com/zhyq-xg/mx',
+ // changeOrigin: true,
+ // rewrite: path => path.replace(/^\/zhyq-xg\/mx/, ''),
+ // },
+
+ '/zhyqapi': {
+ // target: 'http://localhost:8082',
+ target: 'https://wrj.shuixiongit.com/zhyqapi',
+ changeOrigin: true,
+ rewrite: path => path.replace(/^\/zhyqapi/, ''),
},
},
},
--
Gitblit v1.9.3