Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(export): the WeChat total budget is the 30MB WeChat allows

esengine1d0189981b93
diff --git a/docs/astro/src/content/docs/publishing/overview.mdx b/docs/astro/src/content/docs/publishing/overview.mdx
index d8b975da1..db516a27a 100644
--- a/docs/astro/src/content/docs/publishing/overview.mdx
+++ b/docs/astro/src/content/docs/publishing/overview.mdx
@@ -352,7 +352,7 @@ platform's current docs rather than trusting us:
| Target | Limit |
| --- | --- |
-| WeChat MiniGame | 4MB main package, and 20MB across all subpackages |
+| WeChat MiniGame | 4MB main package, and 30MB across the main package and all subpackages |
| Playable ad | whatever the chosen network accepts — Meta 2MB for a single `index.html`, Google 5MB for a ZIP, etc. |
| Web / Desktop / Android / iOS | none published; set your own below |
@@ -370,7 +370,7 @@ host whose cap the editor doesn't know.
It **replaces the target's primary limit** — WeChat's 4MB main-package figure becomes
yours — and is attributed to your project rather than quoted as a platform rule. It's
-not a waiver: WeChat's 20MB total still applies. Clear the field to go back to the
+not a waiver: WeChat's 30MB total still applies. Clear the field to go back to the
platform's own limit.
### Gating a build on size
diff --git a/docs/astro/src/content/docs/zh-cn/publishing/overview.mdx b/docs/astro/src/content/docs/zh-cn/publishing/overview.mdx
index 6e01b80ea..a8f59c61e 100644
--- a/docs/astro/src/content/docs/zh-cn/publishing/overview.mdx
+++ b/docs/astro/src/content/docs/zh-cn/publishing/overview.mdx
@@ -279,7 +279,7 @@ which a block-compressed texture must be
| 目标 | 上限 |
| --- | --- |
-| 微信小游戏 | 主包 4MB,所有分包合计 20MB |
+| 微信小游戏 | 主包 4MB,主包与所有分包合计 30MB |
| 试玩广告 | 取决于所选平台 —— Meta 单个 `index.html` 2MB、Google ZIP 5MB 等 |
| 网页 / 桌面 / Android / iOS | 无公开上限;可用下面的方式自定 |
@@ -289,7 +289,7 @@ which a block-compressed texture must be
**打包项目 → 高级 → 体积预算** 为当前所选目标设置一个 MB 上限,按平台保存在 `packaging.sizeBudget` 里。两种用途:你的包远低于微信 4MB,想在它悄悄涨上去之前就收到提醒;或者你的目标平台上限编辑器并不知道。
-它**替换该目标的主上限** —— 微信那条 4MB 主包数字会换成你的 —— 并且归因为"本项目自定的体积预算",而不是伪装成一条平台规则。它不是豁免:微信的 20MB 总量依然生效。清空该字段即恢复平台自身的上限。
+它**替换该目标的主上限** —— 微信那条 4MB 主包数字会换成你的 —— 并且归因为"本项目自定的体积预算",而不是伪装成一条平台规则。它不是豁免:微信的 30MB 总量依然生效。清空该字段即恢复平台自身的上限。
### 用体积卡构建
diff --git a/pipeline/src/project/sizeBudget.ts b/pipeline/src/project/sizeBudget.ts
index 30f29eb2f..df679ae4f 100644
--- a/pipeline/src/project/sizeBudget.ts
+++ b/pipeline/src/project/sizeBudget.ts
@@ -81,7 +81,7 @@ const NO_BUDGETS: readonly SizeBudget[] = [];
const WECHAT_BUDGETS: readonly SizeBudget[] = [
{ scope: 'initial', maxBytes: 4 * MB, note: "WeChat caps a mini-game's main package at 4MB" },
- { scope: 'total', maxBytes: 20 * MB, note: 'WeChat caps a mini-game at 20MB across all subpackages' },
+ { scope: 'total', maxBytes: 30 * MB, note: 'WeChat caps a mini-game at 30MB across the main package and all subpackages' },
];
/**
diff --git a/pipeline/tests/export-wechat.test.ts b/pipeline/tests/export-wechat.test.ts
index d22ee3af7..f8f1ea472 100644
--- a/pipeline/tests/export-wechat.test.ts
+++ b/pipeline/tests/export-wechat.test.ts
@@ -156,7 +156,7 @@ describe('exportGame (wechat)', () => {
const initial = res.size?.verdicts.find((v) => v.budget.scope === 'initial');
const total = res.size?.verdicts.find((v) => v.budget.scope === 'total');
expect(initial?.budget.maxBytes).toBe(4 * 1024 * 1024);
- expect(total?.budget.maxBytes).toBe(20 * 1024 * 1024);
+ expect(total?.budget.maxBytes).toBe(30 * 1024 * 1024);
expect(initial?.status).toBe('ok');
expect(res.size?.byKind.find((k) => k.kind === 'engine')?.bytes).toBeGreaterThan(0);
// The fixture's subpackage asset (`subpackages/level2/extra.png`, 8 bytes of
@@ -192,7 +192,7 @@ describe('exportGame (wechat)', () => {
expect(initial?.budget.note).toBe('project budget');
// Replacing the main-package limit is not a waiver of the other one.
expect(res.size?.verdicts.find((v) => v.budget.scope === 'total')?.budget.maxBytes)
- .toBe(20 * 1024 * 1024);
+ .toBe(30 * 1024 * 1024);
}, 60_000);
// The platform this matters most on: a mini-game has no `fetch`, so a
diff --git a/pipeline/tests/size-report.test.ts b/pipeline/tests/size-report.test.ts
index 5eb6de6e5..38e6a2cfe 100644
--- a/pipeline/tests/size-report.test.ts
+++ b/pipeline/tests/size-report.test.ts
@@ -165,7 +165,7 @@ describe('budgets', () => {
expect(initial.maxBytes).toBe(2 * MB);
expect(initial.note).toBe(PROJECT_BUDGET_NOTE);
// The platform's OTHER limit still applies — a project ceiling is not a waiver.
- expect(budgets.find((b) => b.scope === 'total')?.maxBytes).toBe(20 * MB);
+ expect(budgets.find((b) => b.scope === 'total')?.maxBytes).toBe(30 * MB);
});
it('gives a target with no limit of its own the project\'s, measured before play', () => {
@@ -179,7 +179,7 @@ describe('budgets', () => {
profile: [{ scope: 'initial', maxBytes: 8 * MB, note: 'this host raised it' }],
});
expect(budgets.find((b) => b.scope === 'initial')?.maxBytes).toBe(8 * MB);
- expect(budgets.find((b) => b.scope === 'total')?.maxBytes).toBe(20 * MB);
+ expect(budgets.find((b) => b.scope === 'total')?.maxBytes).toBe(30 * MB);
});
it('skips a deliverable limit when no upload file was produced', () => {