当前位置:网站首页>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
边栏推荐
- WEB 渗透之端口协议
- Transformer学习
- pytest:开始使用
- C Pitfalls and Defects Chapter 7 Portability Defects 7.11 An Example of a Portability Problem
- 软考 ----- UML设计与分析(上)
- 365 days challenge LeetCode1000 questions - Day 046 Generate a string with odd number of each character + add two numbers + valid parentheses
- 【Jmeter常用断言组件】
- Appendix A printf, varargs and stdarg a. 2 use varargs. H to realize the variable argument list
- 基于php在线音乐网站管理系统获取(php毕业设计)
- XSS漏洞
猜你喜欢
property语法
基于php在线音乐网站管理系统获取(php毕业设计)
51.【结构体初始化的两种方法】
AI应用第一课:支付宝刷脸登录
365天挑战LeetCode1000题——Day 046 生成每种字符都是奇数个的字符串 + 两数相加 + 有效的括号
Day016 类和对象
ModuleNotFoundError: No module named ‘yaml‘
Anacoda的用途
Based on php Xiangxi tourism website management system acquisition (php graduation design)
Based on php online music website management system acquisition (php graduation design)
随机推荐
数据库练习
基于php动漫周边商城管理系统(php毕业设计)
Shell编程条件语句
Chapter 12, target recognition of digital image processing
方舟:生存进化官服和私服区别
Transplant MQTT source code to STM32F407 development board
小程序--独立分包&分包预下载
C Pitfalls and pitfalls Appendix B Interview with Koenig and Moo
数字图像处理 第十二章——目标识别
Appendix A printf, varargs and stdarg A.3 stdarg.h ANSI version of varargs.h
图片识别商品接口 API:天猫淘宝
How to choose Visibility, Display, and Opacity when interacting or animating
方舟开服需要知道的那些事
线上一次JVM FullGC搞得整晚都没睡,彻底崩溃~
FusionGAN:A generative adversarial network for infrared and visible image fusion文章学习笔记
Shell编程之条件语句
【Jmeter常用断言组件】
模拟数据之mockjs
Based on php hotel online reservation management system acquisition (php graduation project)
Based on php Xiangxi tourism website management system acquisition (php graduation design)