From 87e809e62548bc0d1c1cb0b443a602fd9cfce670 Mon Sep 17 00:00:00 2001 From: Syphax Bouazzouni Date: Sun, 29 May 2022 03:21:54 +0200 Subject: [PATCH] use the new Rails 7 js compressor (terser) --- Gemfile | 2 +- config/environments/appliance.rb | 2 +- config/environments/production.rb | 2 +- config/environments/staging.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index bed56dae3..039daac15 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ gem 'rails', '7.0.3' gem 'jsbundling-rails' gem 'sass-rails', '~> 5.0' -gem 'uglifier', '>= 1.0.3' +gem 'terser' #ugilifer replacent # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby # gem 'duktape' diff --git a/config/environments/appliance.rb b/config/environments/appliance.rb index 00bb200de..1d024a0dc 100644 --- a/config/environments/appliance.rb +++ b/config/environments/appliance.rb @@ -21,7 +21,7 @@ # config.action_dispatch.rack_cache = true # Compress JavaScripts and CSS. - config.assets.js_compressor = Uglifier.new(harmony: true) + config.assets.js_compressor = :terser # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. diff --git a/config/environments/production.rb b/config/environments/production.rb index eb9fb9901..33168bd78 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -25,7 +25,7 @@ config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? # Compress JavaScripts - config.assets.js_compressor = Uglifier.new(harmony: true) + config.assets.js_compressor = :terser # Compress CSS using a preprocessor. # config.assets.css_compressor = :sass diff --git a/config/environments/staging.rb b/config/environments/staging.rb index d99703f49..03955a248 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -21,7 +21,7 @@ # config.action_dispatch.rack_cache = true # Compress JavaScripts and CSS. - config.assets.js_compressor = Uglifier.new(harmony: true) + config.assets.js_compressor = :terser # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed.