小程序发布
小程序发布
1. 配置生产环境变量
在 vortmall-uniapp/ 根目录创建或修改 .env.production。
修改 VITE_API_URL、VITE_API_PREFIX,示例:
# .env.production
VITE_API_URL=https://xxx.xxx.xxx
VITE_API_PREFIX=/api
2. 配置 appid
在 vortmall-uniapp/src/manifest.json 配置对应需要打包平台的 appid。
例如微信小程序:mp-weixin.appid

3. 打包
# PLATFORM 是指平台名称:mp-weixin、mp-alipay 等
# npm run build:PLATFORM
# 例如打包微信小程序
npm run build:mp-weixin
运行命令后,会在 vortmall-uniapp/dist/build/PLATFORM/ 生成小程序产物目录。


4. 将 PLATFORM 目录用对应平台工具上传
例如微信:使用微信开发者工具导入 vortmall-uniapp/dist/build/mp-weixin/,然后上传发布。







