// package.json
"scripts": {
"dev:custom": "cross-env NODE_ENV=development uniapp-cli custom",
"build:custom": "cross-env NODE_ENV=production uniapp-cli custom",
"serve:market": "npm run dev:custom market-h5"
},
"uni-app": {
"scripts": {
"lotto-h5": {
"title": "lotto-H5",
"env": {
"UNI_PLATFORM": "h5"
},
"define": {
"LOTTO-H5": true
}
},
"market-h5": {
"title": "market-H5",
"env": {
"UNI_PLATFORM": "h5"
},
"define": {
"MARKET-H5": true
}
}
}
}
// pages.json
"pages": [
// #ifdef LOTTO-H5
{
"path": "pages/lotto/index",
"style": {
"navigationBarTitleText": "页面A"
}
},
// #endif
// #ifdef MARKET-H5
{
"path": "pages/market/index",
"style": {
"navigationBarTitleText": "页面B"
}
}
// #endif
]
华圣灵魂 (作者)
刚好只有两个页面,分属不同平台,这种应该怎么写
2022-05-11 15:38