From 2c1a3d59405176426ecc92574922f8854e3ceb74 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 27 Jul 2021 18:42:13 +0100 Subject: [PATCH] Use terser for javascript compression to get ES6 support --- Gemfile | 4 ++-- Gemfile.lock | 6 +++--- config/environments/production.rb | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 42385a307..918a49747 100644 --- a/Gemfile +++ b/Gemfile @@ -12,8 +12,8 @@ gem "pg" # Use SCSS for stylesheets gem "sassc-rails" -# Use Uglifier as compressor for JavaScript assets -gem "uglifier", ">= 1.3.0" +# Use Terser as compressor for JavaScript assets +gem "terser" # Use jquery as the JavaScript library gem "jquery-rails" diff --git a/Gemfile.lock b/Gemfile.lock index 932435b34..03d21e6bb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -468,12 +468,12 @@ GEM sprockets (>= 3.0.0) strong_migrations (0.7.7) activerecord (>= 5) + terser (1.1.5) + execjs (>= 0.3.0, < 3) thor (1.1.0) tilt (2.0.10) tzinfo (2.0.4) concurrent-ruby (~> 1.0) - uglifier (4.2.0) - execjs (>= 0.3.0, < 3) unicode-display_width (2.0.0) validates_email_format_of (1.6.3) i18n @@ -572,7 +572,7 @@ DEPENDENCIES simplecov simplecov-lcov strong_migrations - uglifier (>= 1.3.0) + terser validates_email_format_of (>= 1.5.1) vendorer webmock diff --git a/config/environments/production.rb b/config/environments/production.rb index fb0c53b97..5c72d449c 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -25,7 +25,7 @@ Rails.application.configure do config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier + config.assets.js_compressor = Terser.new # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. -- 2.39.5