From 83373e0c513a8163c015649e467234d36f9a3915 Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Thu, 12 Jan 2023 17:08:50 -0500 Subject: [PATCH] split build task into parallel and non-parallel versions This allows FoundKey to be built on systems with 2GB or less RAM without swapping or running out of memory. --- docs/install.md | 3 +++ package.json | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index dbdf5e0d0..330c28633 100644 --- a/docs/install.md +++ b/docs/install.md @@ -70,6 +70,8 @@ Build foundkey with the following: `NODE_ENV=production yarn build` +If your system has at least 4GB of RAM, run `NODE_ENV=production yarn build-parallel` to speed up build times. + If you're still encountering errors about some modules, use node-gyp: 1. `npx node-gyp configure` @@ -182,6 +184,7 @@ Use git to pull in the latest changes and rerun the build and migration commands git pull git submodule update --init yarn install +# Use build-parallel if your system has 4GB or more RAM and want faster builds NODE_ENV=production yarn build yarn migrate ``` diff --git a/package.json b/package.json index 4f47f3bf0..659ba2897 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "packages/*" ], "scripts": { - "build": "yarn workspaces foreach --parallel --topological run build && yarn run gulp", + "build": "yarn workspaces foreach --topological run build && yarn run gulp", + "build-parallel": "yarn workspaces foreach --parallel --topological run build && yarn run gulp", "start": "yarn workspace backend run start", "start:test": "yarn workspace backend run start:test", "init": "yarn migrate",