From dd390407bec248cd69aadb17e0d6f442a8a70829 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 1 May 2024 11:00:12 +0100 Subject: [PATCH] Move from Uglifier to Terser govuk_publishing_components has govuk-frontend as a dependency. govuk-frontend v5 now targets browsers that support ES6. This means that the UMD modules used in govuk_publsihing_components from govuk-frontend use features of ES6 and so it means that Uglifier can't be used anymore because it only supports ES5. --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- config/environments/production.rb | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 403a4f2e..bcb84149 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ gem "plek" gem "ratelimit" gem "slimmer" gem "sprockets-rails" -gem "uglifier" +gem "terser" group :development, :test do gem "climate_control" diff --git a/Gemfile.lock b/Gemfile.lock index 0579903c..7f750e1b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -111,7 +111,7 @@ GEM domain_name (0.6.20240107) drb (2.2.1) erubi (1.12.0) - execjs (2.8.1) + execjs (2.9.1) gds-api-adapters (95.1.0) addressable link_header @@ -603,13 +603,13 @@ GEM sprockets (>= 3.0.0) statsd-ruby (1.5.0) stringio (3.1.0) + terser (1.2.2) + execjs (>= 0.3.0, < 3) thor (1.3.1) timecop (0.9.8) timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - uglifier (4.2.0) - execjs (>= 0.3.0, < 3) unicode-display_width (2.5.0) webmock (3.23.0) addressable (>= 2.8.0) @@ -651,8 +651,8 @@ DEPENDENCIES simplecov slimmer sprockets-rails + terser timecop - uglifier webmock RUBY VERSION diff --git a/config/environments/production.rb b/config/environments/production.rb index dda10ef9..b4ae8dc5 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -25,7 +25,7 @@ config.public_file_server.enabled = false # Compress JS using a preprocessor. - config.assets.js_compressor = :uglifier + config.assets.js_compressor = :terser # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false