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>
This commit is contained in:
parent
95c61b88dc
commit
de936f07e5
|
@ -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?
|
||||
|
|
Loading…
Reference in New Issue