当前位置:网站首页>Small program -- subcontracting
Small program -- subcontracting
2022-08-01 21:36:00 【like Feynman %】
1. What is subcontracting
Subcontracting refers to dividing a complete applet project into different according to requirementsSubpackages, which are packaged into different subpackages during construction, and users can load on demand
when they use them.2. The benefits of subcontracting
- You can optimize the download time for the first launch of the applet
- Better decoupling and collaboration
3. Composition of the project before subcontracting
Before subcontracting, all pages and resources in the applet project arePackaged together, resulting in the entire project is too large, affecting the download time of the applet first startup
4. The composition of the project after subcontracting
After subcontracting, it mainly consists of 1 main package + multiple subcontracts:
- Generally only contains the startup page or TabBar page of the project, and all subcontractsSome public resources needed
- Subpackage: Only include pages and private resources related to the current subpackage
5. Subpackage loading rules
When the applet starts, by default it will download the main package and start the page in the main packagespan>
The tabBar page needs to be placed in the main package
When the user enters a page in the subpackage, client will download the corresponding subpackage, and display it after the download is complete
Non-tabBar pages can be divided into different subpackages according to different functions, and then downloaded on demand
6. The volume limit of subcontracting
Currently, there are two restrictions on the size of sub-packages of Mini Programs:
- The size of all sub-packages of this applet project does not exceed 16M (main package + all sub-packages)
- Single subpackage/main package size cannot exceed 2M
7. Use subcontracting
"subpackages": [{"root": "packageA","name": "p1",//Name the package"pages": ["pages/cat","pages/dog"]},{"root": "packageB","name": "p2","pages": ["pages/apple","pages/banana"]}],
8. How to check the volume of the package
9. Packaging principles
- The applet will be subpackaged according to the configuration of subpackages, and the directories other than subpackages will be packagedinto the main package
- The main package can also have its own pages (ie the outermost pages field)
- tabBar page must be in main package
- Subpackages cannot be nested with each other
10. Citation principles
- Main packageCannot referenceprivate resources in subpackages
- cannot refer to each other between subcontractsprivate resources
- Subcontractingcan referencepublic resources in the main package
边栏推荐
猜你喜欢
模拟数据之mockjs
ORI-GB-NP半乳糖介导冬凌草甲素/姜黄素牛血清白蛋白纳米粒的研究制备方法
Day33 LeetCode
磷酸化甘露糖苷修饰白蛋白纳米粒/卵白蛋白-葡聚糖纳米凝胶的
Transplant MQTT source code to STM32F407 development board
Based on php online examination management system acquisition (php graduation design)
Realize the superposition display analysis of DWG drawing with CAD in Cesium
对C语言结构体内存对齐的理解
C语言必杀技3行代码把运行速度提升4倍
Day016 类和对象
随机推荐
Spark cluster construction
PyQt5 + MySQL5.8 【学生信息管理系统】【增删改查】
Transformer学习
正则表达式
磷酸化甘露糖苷修饰白蛋白纳米粒/卵白蛋白-葡聚糖纳米凝胶的
用户量大,Redis没法缓存响应,数据库宕机?如何排查解决?
Based on php animation peripheral mall management system (php graduation design)
C语言_联合体共用体引入
基于php在线考试管理系统获取(php毕业设计)
对C语言结构体内存对齐的理解
Upload markdown documents to blog garden
C Pitfalls and Defects Chapter 7 Portability Defects 7.8 Size of Random Numbers
ARFoundation入门教程U2-AR场景截图截屏
LVS负载均衡群集
(七)《数电》——CMOS与TTL门电路
C语言_typedef和结构体
C Expert Programming Chapter 1 C: Through the Fog of Time and Space 1.5 ANSI C Today
FusionGAN:A generative adversarial network for infrared and visible image fusion文章学习笔记
Based on php Xiangxi tourism website management system acquisition (php graduation design)
C Pitfalls and Defects Chapter 5 Library Functions 5.5 Library Function Signal