Images moved online, uploads pass, then a new entry triggers the main package limit again — is weight reduction not enough or should the project structure be split?
Conclusion first: after moving large local images online, uploads pass, but adding an entry later triggers the main package size limit again. In most cases this is not because the latest change is large, but because the main package has long been running close to the limit, and the newly added page and icons are just the trigger that pushes it over. Under common specifications of mainstream platforms in 2026, the main package limit is typically in the 2 MB range (specific values vary by platform and base library version; refer to official documentation). In terms of order, first bring the size back to a safe line, then split one or two low-frequency packages by business domain. This usually saves rework compared with starting with a full split; only when the overage is clearly large and low-frequency modules account for a high share is it worth changing the directory and routing structure.
Is the main package threshold about total file size or the packaged output?
The main package is the code and resources that must be downloaded first when a user opens the mini program: tabBar pages, global styles, login and request wrappers, and components needed for the first screen are usually inside it; subpackages are pulled only when the user enters a certain business page. The over-limit error appears at the upload step, but the root cause is often buried months earlier — every time an entry is added, several local slices and a library used only on a single page are stuffed in, and the size gradually piles up to the threshold.
Size should be calculated based on the packaged and compressed output, not source line count, and not the original dimensions of images in design files. In experience, size-heavy items are concentrated in several categories: uncompressed product images and background images, fonts without subsetting, fully featured third-party SDKs, UI component libraries imported as a whole, and time and encryption utility functions repeatedly imported by multiple pages. First look at the size composition in developer tools, then decide what to cut. This is much more effective than deleting code by feel.
- Common size-heavy items: large local images and animated images, uncropped font subsets, component libraries imported as a whole, and map and analytics SDKs.
- Easy to miss: old components left from early multi-end reuse, fake data JSON used for debugging, and old pages that were commented out but not deleted.
- Headroom guideline: leave about 10%–20% headroom below the main package limit (experience range), so adding an entry in daily work does not hit the line every time.
Reduce weight first or split packages first: the difference between the two paths
Putting weight reduction before package splitting is based on a practical reason: splitting is a structural adjustment that touches directories, routing, and references, and mistakes require a full regression round; weight reduction is local replacement, has low risk, and shows size changes the same day. A common situation in projects is that after one round of weight reduction, the number of packages that need to be split is halved, and some projects do not need splitting at all.
- Look at the size report: use the platform's built-in size analysis or build output list to list the top five contributors by share, and do not rush to change code first.
- Look at images and fonts: move large local images to CDN, output images at actual display size, and switch to more size-efficient formats; subset fonts or use system fonts directly.
- Look at dependencies: change component libraries to on-demand imports, merge duplicate utility libraries into one, and replace heavy libraries used only on individual pages with lightweight implementations.
- Cut dead code and duplicate styles: delete unused pages, fake data, and comment blocks, and merge duplicate global styles.
How to set the acceptance bar: after one round of weight reduction, the main package can usually free up hundreds of KB (experience range, depending on project status), and first-screen entry time often improves perceptibly. If it is still close to the limit after weight reduction, then split packages. At that point the business scope to split is much clearer, and mistakes are less likely.
The cost difference between the two paths can be compared using the following dimensions (ranges are experience values and vary with project scale and team familiarity):
- Path 1: full split by business domain — typical range: 1–3 weeks, with a large regression scope and wide change surface. Suitable for medium-to-large projects where the main package clearly exceeds the limit and new business will continue to be added.
- Path 2: reduce weight first and split only one or two low-frequency packages — typical range: 2–5 working days, with a small regression scope. Suitable for campaign-style projects or scenarios with only a small overage.
- Path 3: only externalize resources without changing structure — typical range: 0.5–2 working days. Suitable for projects with an overage within hundreds of KB and few subsequent changes.
The criterion for judging success is not 'how many packages were split' but three things: uploads pass in one go, first-screen entry time does not get worse, and future feature additions do not require another split every time.
When the campaign schedule has only two weeks left, which end should be tackled first?
A common constraint in delivery work looks like this: the client's campaign schedule has only two weeks left, assets are still arriving, the main package is already close to the line, and everyone worries the next version will exceed the limit again. At this point, putting 'package splitting + full regression' into the same iteration carries high risk — once directories change, routing, navigation parameters, and tracking all need regression, and the schedule does not allow mistakes.
Our approach in such projects is: first do resource externalization and on-demand dependency imports to bring the size back to a safe line, and schedule package splitting separately for the next version, when requirements are frozen and regression time is sufficient. The result is that this version launches on schedule and the regression scope is controllable; the cost is that this version still requires manual monitoring of size changes, running a size report before each test submission, and clearly telling the client in advance that the next version still includes structural rework. Do not wait until the next real over-limit to mention it.
If you really need to split, which dimension avoids rework?
The essence of subpackage division is to put 'things often used together' together. Splitting by business domain (orders, membership, after-sales, campaigns) is usually easier to maintain than splitting by page: components, API wrappers, and styles within one business domain go into the same package, so cross-package references are fewer. Conversely, splitting as 'one page per package' causes shared code to be repeatedly packaged into multiple subpackages, making total package size larger instead.
- Must stay in the main package: tabBar pages, global styles and theme variables, login and request wrappers, and components needed for first-screen rendering.
- Suitable for subpackages: low-frequency business (invoices, after-sales, secondary settings pages), campaign topic pages, and interaction-heavy pages (maps, charts, rich text editing).
- Division priority: first by business domain, then by usage frequency; page-level division usually makes sense only for individual very large pages.
- Common pitfalls: shared code between subpackages is repeatedly packaged, too many subpackages cause confusing pre-download configuration, and there is no loading state when navigating to a subpackage, so users think it is frozen.
On package count, the experience range is commonly 3–5 business subpackages; beyond that, calculate the maintenance cost of pre-download and configuration again. Do not cut packages into pieces just to make the 'structure look good'.
Which projects are suitable for splitting, and which should be left alone for now
The cases worth acting on are clear: the main package has exceeded the limit multiple times, the business line will continue to add pages, and low-frequency functions account for an obvious share (invoices, after-sales, secondary settings pages, and similar). The cases where subpackages are unnecessary are equally clear: the main package still has headroom, or this overage is only caused by a few images and an uncropped font. Replacing resources first is more cost-effective than changing structure.
- Suitable: projects with many functional modules, a stable iteration rhythm, and new business to be added later.
- Not necessary: projects with sufficient main package headroom, where the overage is caused by a single resource file, or small utility mini programs that will basically no longer change after launch.
- Do not split yet: when the schedule has only a few days left and there is no regression testing time; in this case, prioritize externalizing resources to protect the launch.
- Also note: for subpackages involving payment and login flows, navigation and state restoration must be verified separately; do not only check whether the package can be uploaded.
When unsure, first check the main package's actual headroom according to official documentation and recent submission records, then decide whether to reduce weight or split packages. Do not restructure the whole directory just because of one upload error.
Common questions
If I only move images online, will uploads stay under the limit for good?
It is mostly enough in the short term, but not necessarily in the long term. Besides resources, dependencies and dead code also grow; in experience, without constraints, it will get close to the line again in one or two months, so running a size report before each test submission is more reliable.
Images are already hosted online but the over-limit warning still appears — where should I look?
Look at the code side: component libraries imported as a whole, duplicate third-party SDKs, unreferenced old pages, and fake data. These categories often account for a higher share in size reports than images.
Is splitting into more subpackages always better?
No. Too many packages increase the maintenance cost of pre-download and configuration, and shared code may be repeatedly packaged; the typical range is 3–5 business packages, and beyond that the maintenance cost needs to be recalculated.
After splitting subpackages, the first screen becomes slower — what are the common causes?
Common causes are low-frequency components still remaining in the main package, no loading state for subpackage navigation, or pre-download not configured according to real access paths, making users feel they are waiting. First check the main package composition, then review the pre-download strategy.
Action guidance: first run a size report to judge the overage magnitude — for hundreds of KB, prioritize resource externalization and on-demand imports; at the MB range, then change the structure. Split packages by business domain, split only low-frequency modules, and leave about 10%–20% headroom for the main package (experience range). This approach applies to projects where the main package has long been close to the line and the business will continue to add features; if the mini program will basically no longer change after launch, just externalize resources to bring it back to a safe line, and there is no need to restructure the whole directory for one error.
-
Well-Recognized Custom E-Commerce Mall System DevThe Good Shopping mini-app is natively buil ...
-
Anhui Huixiang Vegetable Garden Agricultural Products Mini Program v2.0 Iteration DevelopmentHuiXiang MiniApp V2.0: Upgraded homepage, n ...
-
Kunshan TrialBook Mini-Program Custom DevelopmentThis project developed an English-only Tria ...
-
Agricultural Products WeChat Mini Program Custom DevelopmentLvran Di enhances agricultural sales via a ...
-
Grandparents turned WeChat font size up one notch—mini program button text wraps and the custom tab bar drifts. Is it hard-coded heights or uncontrolled font size?
Date: Nov 23, 2026 Read: 8
-
Why does tapping again while the order page is spinning create a duplicate order—is the button not locked, or is the API failing to recognize it?
Date: Nov 22, 2026 Read: 17
-
A poster can be recognized by long-pressing it in chat but does nothing on a Mini Program page—what step is missing?
Date: Nov 21, 2026 Read: 29
-
Mini program 'Locate to current position' lands in the neighboring community: approximate location or a coordinate conversion error?
Date: Nov 20, 2026 Read: 23
-
When I switch a mini program to a custom top navigation bar, why does the capsule button in the top-right keep covering the title—is the status bar height wrong or is the title width not clearing it?
Date: Nov 19, 2026 Read: 31




