From ba0c433f9b667cec44497ec418d0ac1904bc5b42 Mon Sep 17 00:00:00 2001 From: Mario Manno Date: Mon, 25 Dec 2023 20:02:18 +0100 Subject: [PATCH] Specify uglifier as symbol instead Failed to deploy on production with: Uglifier::Error: ../gems/uglifier-4.2.0/lib/uglifier.rb:291:in `parse_result' See lautis/uglifier/issues/185 --- config/deploy.rb | 2 +- config/environments/production.rb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index b06c992e..3d029c3b 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,5 +1,5 @@ # config valid only for current version of Capistrano -lock '3.17.0' +lock '3.17.1' set :application, 'media-site' set :repo_url, ENV['CAP_REPO'] diff --git a/config/environments/production.rb b/config/environments/production.rb index 35d72206..3633ddbb 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -25,7 +25,10 @@ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? # Compress JavaScripts and CSS. - config.assets.js_compressor = Uglifier.new(harmony: true, compress: { keep_fnames: true }) if defined? Uglifier + config.assets.configure do |env| + env.js_compressor = :uglifier # or :closure, :yui + env.css_compressor = :sass # or :yui + end # Compress CSS using a preprocessor. # config.assets.css_compressor = :sass