From de936f07e56e7d1147b2433353952a53af2053f5 Mon Sep 17 00:00:00 2001
From: Rafael dos Santos Silva <xfalcox@gmail.com>
Date: Tue, 12 Dec 2023 14:05:20 -0300
Subject: [PATCH] PERF: Update node_options during ember build for low end
 servers (#24850)

See https://meta.discourse.org/t/286643/14

Co-authored-by: David Taylor <david@taylorhq.com>
---
 lib/tasks/assets.rake | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake
index b22beda1213..2e77fb6302d 100644
--- a/lib/tasks/assets.rake
+++ b/lib/tasks/assets.rake
@@ -22,14 +22,9 @@ task "assets:precompile:build" do
 
     heap_size_limit = check_node_heap_size_limit
 
-    if heap_size_limit < 1024
-      STDERR.puts "Node.js heap_size_limit (#{heap_size_limit}) is less than 1024MB. Setting --max-old-space-size=1024."
-      compile_command = "NODE_OPTIONS='--max-old-space-size=1024' #{compile_command}"
-    end
-
     if heap_size_limit < 2048
-      STDERR.puts "Node.js heap_size_limit (#{heap_size_limit}) is less than 2048MB. Disabling Webpack parallelization with JOBS=0 to conserve memory."
-      compile_command = "JOBS=0 #{compile_command}"
+      STDERR.puts "Node.js heap_size_limit (#{heap_size_limit}) is less than 2048MB. Setting --max-old-space-size=2048."
+      compile_command = "NODE_OPTIONS='--max-old-space-size=2048' #{compile_command}"
     end
 
     compile_command = "EMBER_ENV=production #{compile_command}" if ENV["EMBER_ENV"].nil?