mirror of https://github.com/openclaw/openclaw.git
perf(build): deduplicate plugin-sdk chunks to fix ~2x memory regression
Bundle all plugin-sdk entries in a single tsdown build pass instead of 38 separate builds. The separate builds prevented the bundler from sharing common chunks, causing massive duplication (e.g. 20 copies of query-expansion, 14 copies of fetch, 11 copies of logger). Measured impact: - dist/ size: 190MB → 64MB (-66%) - plugin-sdk/ size: 142MB → 16MB (-89%) - JS files: 1,395 → 789 (-43%) - 5MB+ files: 27 → 7 (-74%) - Plugin-SDK heap cost: +1,309MB → +63MB (-95%) - Total heap (all chunks loaded): 1,926MB → 711MB (-63%)
This commit is contained in:
parent
592d93211f
commit
ccced29b46
|
|
@ -116,12 +116,12 @@ export default defineConfig([
|
|||
"line/template-messages": "src/line/template-messages.ts",
|
||||
},
|
||||
}),
|
||||
...pluginSdkEntrypoints.map((entry) =>
|
||||
nodeBuildConfig({
|
||||
entry: `src/plugin-sdk/${entry}.ts`,
|
||||
outDir: "dist/plugin-sdk",
|
||||
}),
|
||||
),
|
||||
nodeBuildConfig({
|
||||
// Bundle all plugin-sdk entries in a single build so the bundler can share
|
||||
// common chunks instead of duplicating them per entry (~712MB heap saved).
|
||||
entry: Object.fromEntries(pluginSdkEntrypoints.map((e) => [e, `src/plugin-sdk/${e}.ts`])),
|
||||
outDir: "dist/plugin-sdk",
|
||||
}),
|
||||
nodeBuildConfig({
|
||||
entry: "src/extensionAPI.ts",
|
||||
}),
|
||||
|
|
|
|||
Loading…
Reference in New Issue