A platform for community discussion. Free, open, simple.
FIX: Skip ember-cli build memory optimisation for multiple rake tasks (#16198)
David Taylorc58c2f53e816
diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rakeindex 24eac30fda3..68b5db61ac5 100644--- a/lib/tasks/assets.rake+++ b/lib/tasks/assets.rake@@ -14,11 +14,15 @@ task 'assets:precompile:before' doendif EMBER_CLI && !(ENV["EMBER_CLI_COMPILE_DONE"] == "1")- # Using exec to free up Rails app memory during ember build- exec <<~SH- NODE_OPTIONS='--max-old-space-size=2048' yarn --cwd app/assets/javascripts/discourse run ember build -prod && \- EMBER_CLI_COMPILE_DONE=1 bin/rake assets:precompile- SH+ compile_command = "NODE_OPTIONS='--max-old-space-size=2048' yarn --cwd app/assets/javascripts/discourse run ember build -prod"+ only_assets_precompile_remaining = (ARGV.last == "assets:precompile")++ if only_assets_precompile_remaining+ # Using exec to free up Rails app memory during ember build+ exec "#{compile_command} && EMBER_CLI_COMPILE_DONE=1 bin/rake assets:precompile"+ else+ system compile_command+ endend# Ensure we ALWAYS do a clean build