FIX: Skip ember-cli build memory optimisation for multiple rake tasks (#16198)
This commit is contained in:
parent
30a5c01f11
commit
c58c2f53e8
|
@ -14,11 +14,15 @@ task 'assets:precompile:before' do
|
|||
end
|
||||
|
||||
if EMBER_CLI && !(ENV["EMBER_CLI_COMPILE_DONE"] == "1")
|
||||
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 <<~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
|
||||
exec "#{compile_command} && EMBER_CLI_COMPILE_DONE=1 bin/rake assets:precompile"
|
||||
else
|
||||
system compile_command
|
||||
end
|
||||
end
|
||||
|
||||
# Ensure we ALWAYS do a clean build
|
||||
|
|
Loading…
Reference in New Issue