From ecc07fd8dce6d0c599f7452be6b4200f250cd91c Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 8 Feb 2022 10:03:53 +0000 Subject: [PATCH] DEV: Make Ember CLI assets the default in production (#15861) This was reverted in e92f57255de429fcf12c4259235d88c5485d934f due to memory usage concerns. This memory issue was resolved by 4cceb55621aa5a25c72415d78a43bd62be68d68d. --- app/controllers/qunit_controller.rb | 2 +- config/application.rb | 2 +- lib/tasks/assets.rake | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/qunit_controller.rb b/app/controllers/qunit_controller.rb index 003b3430245..2abd0744e49 100644 --- a/app/controllers/qunit_controller.rb +++ b/app/controllers/qunit_controller.rb @@ -23,7 +23,7 @@ class QunitController < ApplicationController @is_proxied = is_ember_cli_proxy? @legacy_ember = if Rails.env.production? - ENV['EMBER_CLI_PROD_ASSETS'] != "1" + ENV['EMBER_CLI_PROD_ASSETS'] == "0" else !@is_proxied end diff --git a/config/application.rb b/config/application.rb index 1c4a0bb51b4..072b86f6d1f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -180,7 +180,7 @@ module Discourse discourse/tests/test_starter.js } - if ENV['EMBER_CLI_PROD_ASSETS'] != "1" + if ENV['EMBER_CLI_PROD_ASSETS'] == "0" config.assets.precompile += %w{ discourse/tests/test-support-rails.js discourse/tests/test-helpers-rails.js diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index 31ba3ba30f2..00ad394cc7d 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -35,7 +35,7 @@ task 'assets:precompile:before' do require 'sprockets' require 'digest/sha1' - if ENV['EMBER_CLI_PROD_ASSETS'] == "1" + if ENV['EMBER_CLI_PROD_ASSETS'] != "0" # Remove the assets that Ember CLI will handle for us Rails.configuration.assets.precompile.reject! do |asset| asset.is_a?(String) && @@ -312,7 +312,7 @@ end task 'assets:precompile' => 'assets:precompile:before' do - copy_ember_cli_assets if ENV['EMBER_CLI_PROD_ASSETS'] == '1' + copy_ember_cli_assets if ENV['EMBER_CLI_PROD_ASSETS'] != '0' refresh_days = GlobalSetting.refresh_maxmind_db_during_precompile_days