已发布了一版没有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 环境 #mode 环境
VITE_MODE = dev 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_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/' 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 uni from "@dcloudio/vite-plugin-uni";
import tailwindcss from "tailwindcss"; import tailwindcss from "tailwindcss";
import autoprefixer from "autoprefixer"; import autoprefixer from "autoprefixer";
@ -24,38 +24,21 @@ if (!weappTailwindcssDisabled) {
} }
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => { export default defineConfig({
console.log("mode:", mode); plugins: [
const env = loadEnv(mode, process.cwd(), ""); uni(),
return { uniRouter({
plugins: [ includes: ["style"],
uni(), }),
uniRouter({ weappTailwindcssDisabled ? undefined : vwt(),
includes: ["style"], ],
}), css: {
weappTailwindcssDisabled ? undefined : vwt(), postcss: {
], plugins: postcssPlugin,
css: {
postcss: {
plugins: postcssPlugin,
},
}, },
server: { },
port: 8991, server: {
}, port: 8991,
base: mode != "dev" ? env.VITE_CDN_DIR : "./", },
build: { base: "./",
assetsDir: "static", // 静态资源存放目录(默认是 assets
rollupOptions: {
output: {
// 代码分割配置
manualChunks: (id) => {
if (id.includes("node_modules")) {
return "vendor";
}
},
},
},
},
};
}); });