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
|
end
|
||||||
|
|
||||||
if EMBER_CLI && !(ENV["EMBER_CLI_COMPILE_DONE"] == "1")
|
if EMBER_CLI && !(ENV["EMBER_CLI_COMPILE_DONE"] == "1")
|
||||||
# Using exec to free up Rails app memory during ember build
|
compile_command = "NODE_OPTIONS='--max-old-space-size=2048' yarn --cwd app/assets/javascripts/discourse run ember build -prod"
|
||||||
exec <<~SH
|
only_assets_precompile_remaining = (ARGV.last == "assets:precompile")
|
||||||
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
|
if only_assets_precompile_remaining
|
||||||
SH
|
# 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
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Ensure we ALWAYS do a clean build
|
# Ensure we ALWAYS do a clean build
|
||||||
|
|
Loading…
Reference in New Issue