Files
cindy/scripts/shared/desktop-dev-node-options.mjs
Lizi ed48ee70a3 feat(agent-net): complete relay sharing and account isolation
Include relay sharing dialogs, global approvals, same-account discovery and joins, V2 tenant isolation, and guest sharing recovery and error fixes. Verify Agent-Net remains disabled by default for new installations and upgrades without an explicit preference.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Lizi <jiali@magiclizi.com>
2026-11-10 22:48:58 +08:00

19 lines
622 B
JavaScript

/**
* Leave headroom for the retained main/worker watch graphs and the renderer's
* cold-start transforms. An explicit developer override always wins.
*/
export const DESKTOP_DEV_MAX_OLD_SPACE = 8192;
const MAX_OLD_SPACE_OPTION = /(?:^|\s)--max[-_]old[-_]space[-_]size(?:=|\s)/;
export function withDesktopDevNodeOptions(env = process.env) {
const next = { ...env };
const existing = next.NODE_OPTIONS?.trim() ?? '';
if (!MAX_OLD_SPACE_OPTION.test(existing)) {
next.NODE_OPTIONS = [existing, `--max-old-space-size=${DESKTOP_DEV_MAX_OLD_SPACE}`]
.filter(Boolean)
.join(' ');
}
return next;
}