已发布了一版没有cdn的版本

This commit is contained in:
梁泽军 2025-03-13 19:07:03 +08:00
parent 4213c2c9e0
commit ef3fd40ff4
3 changed files with 20 additions and 39 deletions

View File

@ -1,9 +1,7 @@
#mode 环境
VITE_MODE = dev
#服务器域名
VITE_HOST = http://192.168.1.249:8084/
# 请求域名
VITE_APP_BASE_URL='http://192.168.1.249:8084/ai-agent-server/'
# VITE_APP_BASE_URL='http://192.168.1.249:8084/ai-agent-server/'
VITE_APP_BASE_URL='https://info.xglpa.com/ai-agent-server'

View File

@ -5,7 +5,7 @@ VITE_MODE = production
VITE_HOST = https://test.szxgl.cn/
# 请求域名
VITE_APP_BASE_URL='https://test.szxgl.cn/ai-agent-server/'
VITE_APP_BASE_URL='https://info.xglpa.com/ai-agent-server'
#静态资源目录
VITE_CDN_DIR = 'https://cdn.xglpa.com/ai-agent-m/'

View File

@ -1,4 +1,4 @@
import { defineConfig, loadEnv } from "vite";
import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import tailwindcss from "tailwindcss";
import autoprefixer from "autoprefixer";
@ -24,10 +24,7 @@ if (!weappTailwindcssDisabled) {
}
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
console.log("mode:", mode);
const env = loadEnv(mode, process.cwd(), "");
return {
export default defineConfig({
plugins: [
uni(),
uniRouter({
@ -43,19 +40,5 @@ export default defineConfig(({ command, mode }) => {
server: {
port: 8991,
},
base: mode != "dev" ? env.VITE_CDN_DIR : "./",
build: {
assetsDir: "static", // 静态资源存放目录(默认是 assets
rollupOptions: {
output: {
// 代码分割配置
manualChunks: (id) => {
if (id.includes("node_modules")) {
return "vendor";
}
},
},
},
},
};
base: "./",
});