From 8608ce72b3b7d0aa8ddc287ecb4493236c2687ce Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Wed, 15 May 2024 17:44:13 -0700 Subject: [PATCH] build(package.json): set JS heap to 3 GB for typescript compilation On a laptop with 16 GB RAM the default JS heap size is not enough anymore to do a full typescript build of the project from scratch. The size of the heap for NodeJS processes gets determined at runtime by an algorithm that (most likely) depends on the total RAM in your computer: https://stackoverflow.com/a/75555120 For laptops with 16 GB RAM or less, the heap ends up being calculated to an amount that is too low at this size of the project so we have to give it a little nudge by specifying the parameter for heap size explicitly to be 3 GB instead of the default. Signed-off-by: Peter Somogyvari --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b0dbd2f8ee..8d6a37e40c 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "build:prod": "npm-run-all build:prod:frontend", "build:prod:frontend": "lerna run build:prod:frontend", "build:dev": "npm-run-all build:dev:backend webpack:dev:web build:dev:frontend", - "build:dev:backend": "npm-run-all tsc build:dev:backend:postbuild", + "build:dev:backend": "NODE_OPTIONS=\"--max_old_space_size=3072\" npm-run-all tsc build:dev:backend:postbuild", "build:dev:frontend": "lerna run build:dev:frontend --scope='@hyperledger/cactus-example-*-frontend' --scope='@hyperledger/cacti-ledger-browser'", "build:dev:common": "lerna exec --stream --scope '*/*common' -- 'del-cli dist/** && tsc --project ./tsconfig.json && webpack --env=dev --target=node --config ../../webpack.config.js'", "build:dev:backend:postbuild": "lerna run build:dev:backend:postbuild",