增加一个packages目录然后在pages.json内添加分包内容
{
"pages": [{
"path": "pages/home/home",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/login/wxlogin",
"style": {
"navigationBarTitleText": "微信登录",
"navigationBarTextStyle": "black",
"navigationBarBackgroundColor": "#ffffff"
}
}],
"subPackages": [{
"root": "packages",
"pages": [{
"path": "pages/my/withdraw/withdraw",
"style": {
"navigationBarTitleText": "提现",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#2662EB"
}
}
]
}]
}
在manifest.json源码模式内添加分包优化代码
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false,
"minified" : true
},
"optimization" : {
"subPackages" : true
},
"runmode" : "liberate",
"usingComponents" : true
},