1. Enable custom subcontracting configuration items in the manifest.json source code view
"mp-weixin": {
"optimization": {
"subPackages": true
}
},
2. Configure the subcontracting path in pages.json
The format of the main package path remains unchanged.
"pages": [{
"path": "pages/index/index",
},
{
"path": "pages/my/my",
}]
Create a new sub-packaging folder at the same level as pages to store sub-packaging files (just separate the page vue files, custom component static resources and api requests do not need to be separated). I have divided them into two packages here.
Subcontracting format:
Under the pages.json file, create a "subPackages" file at the same level as "pages" as the subpackage path.
Root is used to write the name of the subpackage folder. The full path of the subpackage path is: root root path + path path. Then the subpackage is completed. The paths of tabbar are placed in the main package.
"subPackages": [{
"root": "pages_shouye",
"pages": [{
"path": "shouyebaobiao/lsyjto/dpph",
"style": {
"navigationBarTitleText": "店铺排行"
}
},
{
"path": "shouyebaobiao/lsyjto/dpxsmx",
"style": {
"navigationBarTitleText": "店铺销售明细"
}
}]
}]