小程序限制每个包代码量不超过2M,如果我们的小程序确实很复杂,代码量操过2M,应该如何解决呢?
设置 忽略文件的设置 即可
"packOptions": {
"ignore": [
{
"value": "static/uploads",
"type": "folder"
}
],
"include": []
},
创建分包,会自动创建文件夹
"subPackages": [
{
"root": "subpkg_user",
"pages": [
"pages/profile/profile",
"pages/order/order"
]
}
],
配置预加载
"preloadRule": {
"pages/index/index":{
"network":"all",
"packages": ["subpkg_user"]
}
},