编译配置更新

This commit is contained in:
yuantao
2025-11-13 10:05:13 +08:00
parent d8e560536a
commit 1f3600103e
2 changed files with 4 additions and 1 deletions

3
.env
View File

@@ -1,4 +1,5 @@
VITE_BASE_URL= #接口地址 VITE_BASE_URL= #接口地址
VITE_ASSETSURL=https://cdn.vrupup.com/s/1598/assets/ #资源地址 VITE_ASSETSURL=https://cdn.vrupup.com/s/1598/assets/ #资源地址
VITE_APPID=wx9cb717d8151d8486 #小程序APPID VITE_APPID=wx9cb717d8151d8486 #小程序APPID
VITE_UNI_APPID=_UNI_8842336 #UNI-APPID VITE_UNI_APPID=_UNI_8842336 #UNI-APPID
VITE_LIBVERSION=3.0.0 #微信小程序基础库

View File

@@ -25,6 +25,7 @@ function replaceManifestAppid() {
dotenv.config({ path: resolve(__dirname, '.env') }) dotenv.config({ path: resolve(__dirname, '.env') })
const appid = process.env.VITE_APPID const appid = process.env.VITE_APPID
const uni_appId = process.env.VITE_UNI_APPID const uni_appId = process.env.VITE_UNI_APPID
const libVersion = process.env.VITE_LIBVERSION || '3.0.0'
if (appid && uni_appId) { if (appid && uni_appId) {
// 读取 manifest.json 文件 // 读取 manifest.json 文件
@@ -37,6 +38,7 @@ function replaceManifestAppid() {
if (manifest['mp-weixin']) { if (manifest['mp-weixin']) {
manifest['mp-weixin'].appid = appid manifest['mp-weixin'].appid = appid
manifest['mp-weixin'].libVersion = libVersion
} }
// 写回文件 // 写回文件