feat: 支持多端同时开发调试 #1
|
|
@ -1,3 +1,4 @@
|
||||||
# 配置文档参考 https://taro-docs.jd.com/docs/next/env-mode-config
|
# 配置文档参考 https://taro-docs.jd.com/docs/next/env-mode-config
|
||||||
# TARO_APP_ID="开发环境下的小程序 AppID"
|
# TARO_APP_ID="开发环境下的小程序 AppID"
|
||||||
TARO_APP_ID=ttbfd9c96420ec8f8201
|
TARO_APP_ID_WEAPP=wxb51f0b0c3aad7cdf
|
||||||
|
TARO_APP_ID_TT=ttbfd9c96420ec8f8201
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
# TARO_APP_ID="生产环境下的小程序 AppID"
|
# 配置文档参考 https://taro-docs.jd.com/docs/next/env-mode-config
|
||||||
TARO_APP_ID=ttbfd9c96420ec8f8201
|
# TARO_APP_ID="开发环境下的小程序 AppID"
|
||||||
|
TARO_APP_ID_WEAPP=wxb51f0b0c3aad7cdf
|
||||||
|
TARO_APP_ID_TT=ttbfd9c96420ec8f8201
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
# TARO_APP_ID="测试环境下的小程序 AppID"
|
# 配置文档参考 https://taro-docs.jd.com/docs/next/env-mode-config
|
||||||
TARO_APP_ID=ttbfd9c96420ec8f8201
|
# TARO_APP_ID="开发环境下的小程序 AppID"
|
||||||
|
TARO_APP_ID_WEAPP=wxb51f0b0c3aad7cdf
|
||||||
|
TARO_APP_ID_TT=ttbfd9c96420ec8f8201
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,16 @@ import prodConfig from './prod'
|
||||||
|
|
||||||
// https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数
|
// https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数
|
||||||
export default defineConfig<'vite'>(async (merge) => {
|
export default defineConfig<'vite'>(async (merge) => {
|
||||||
|
// 不同平台的 appId 配置
|
||||||
|
const appIds = {
|
||||||
|
weapp: process.env.TARO_APP_ID_WEAPP || 'your-weapp-appid',
|
||||||
|
tt: process.env.TARO_APP_ID_TT || 'your-tt-appid',
|
||||||
|
alipay: process.env.TARO_APP_ID_ALIPAY || 'your-alipay-appid',
|
||||||
|
swan: process.env.TARO_APP_ID_SWAN || 'your-swan-appid',
|
||||||
|
qq: process.env.TARO_APP_ID_QQ || 'your-qq-appid',
|
||||||
|
jd: process.env.TARO_APP_ID_JD || 'your-jd-appid'
|
||||||
|
}
|
||||||
|
|
||||||
const baseConfig: UserConfigExport<'vite'> = {
|
const baseConfig: UserConfigExport<'vite'> = {
|
||||||
projectName: 'bw-mini-app',
|
projectName: 'bw-mini-app',
|
||||||
date: '2025-9-1',
|
date: '2025-9-1',
|
||||||
|
|
@ -16,7 +26,7 @@ export default defineConfig<'vite'>(async (merge) => {
|
||||||
828: 1.81 / 2
|
828: 1.81 / 2
|
||||||
},
|
},
|
||||||
sourceRoot: 'src',
|
sourceRoot: 'src',
|
||||||
outputRoot: 'dist',
|
outputRoot: process.env.TARO_ENV ? `dist/${process.env.TARO_ENV}` : 'dist',
|
||||||
plugins: [
|
plugins: [
|
||||||
"@tarojs/plugin-generator"
|
"@tarojs/plugin-generator"
|
||||||
],
|
],
|
||||||
|
|
@ -47,6 +57,31 @@ export default defineConfig<'vite'>(async (merge) => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// 小程序平台特定配置
|
||||||
|
weapp: {
|
||||||
|
outputRoot: 'dist/weapp',
|
||||||
|
appId: appIds.weapp
|
||||||
|
},
|
||||||
|
tt: {
|
||||||
|
outputRoot: 'dist/tt',
|
||||||
|
appId: appIds.tt
|
||||||
|
},
|
||||||
|
alipay: {
|
||||||
|
outputRoot: 'dist/alipay',
|
||||||
|
appId: appIds.alipay
|
||||||
|
},
|
||||||
|
swan: {
|
||||||
|
outputRoot: 'dist/swan',
|
||||||
|
appId: appIds.swan
|
||||||
|
},
|
||||||
|
qq: {
|
||||||
|
outputRoot: 'dist/qq',
|
||||||
|
appId: appIds.qq
|
||||||
|
},
|
||||||
|
jd: {
|
||||||
|
outputRoot: 'dist/jd',
|
||||||
|
appId: appIds.jd
|
||||||
|
},
|
||||||
h5: {
|
h5: {
|
||||||
publicPath: '/',
|
publicPath: '/',
|
||||||
staticDirectory: 'static',
|
staticDirectory: 'static',
|
||||||
|
|
|
||||||
|
|
@ -1 +1,15 @@
|
||||||
{"miniprogramRoot":"./dist","projectname":"bw-mini-app","description":"图生图 风格转换 ","appid":"ttbfd9c96420ec8f8201","setting":{"urlCheck":true,"es6":true,"enhance":false,"compileHotReLoad":false,"postcss":false,"minified":false},"compileType":"miniprogram"}
|
{
|
||||||
|
"miniprogramRoot": "./dist/weapp",
|
||||||
|
"projectname": "bw-mini-app",
|
||||||
|
"description": "图生图 风格转换 ",
|
||||||
|
"appid": "wxb51f0b0c3aad7cdf",
|
||||||
|
"setting": {
|
||||||
|
"urlCheck": true,
|
||||||
|
"es6": true,
|
||||||
|
"enhance": false,
|
||||||
|
"compileHotReLoad": false,
|
||||||
|
"postcss": false,
|
||||||
|
"minified": false
|
||||||
|
},
|
||||||
|
"compileType": "miniprogram"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"miniprogramRoot": "./dist/tt",
|
||||||
|
"projectname": "bw-mini-app",
|
||||||
|
"appid": "ttbfd9c96420ec8f8201"
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue