From 9c97816e809ccb29a9252a93c9dbd0c6eb260a31 Mon Sep 17 00:00:00 2001 From: Ben Rexin Date: Sat, 27 Dec 2025 09:58:35 +0100 Subject: [PATCH] fix: uglifier can't handle ES6 and minified source correctly --- Gemfile | 2 +- Gemfile.lock | 6 +++--- config/environments/production.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 783ec29fe..e1152d1b9 100644 --- a/Gemfile +++ b/Gemfile @@ -33,7 +33,7 @@ gem 'whitelabel' gem 'bootstrap', '~> 5.3' gem 'font-awesome-rails' gem 'sass-rails' -gem 'uglifier' +gem 'terser' group :production do gem 'dalli' diff --git a/Gemfile.lock b/Gemfile.lock index c92955d8e..3a8f8c2c9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -398,6 +398,8 @@ GEM activesupport (>= 6.1) sprockets (>= 3.0.0) temple (0.10.3) + terser (1.2.6) + execjs (>= 0.3.0, < 3) thor (1.4.0) tilt (2.6.0) timeout (0.4.3) @@ -405,8 +407,6 @@ GEM ethon (>= 0.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - uglifier (4.2.1) - execjs (>= 0.3.0, < 3) unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) @@ -477,7 +477,7 @@ DEPENDENCIES simple_form slim-rails sprockets (~> 3.7) - uglifier + terser validate_url web-console whitelabel diff --git a/config/environments/production.rb b/config/environments/production.rb index b3051c962..325781f34 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -28,7 +28,7 @@ # Compress CSS using a preprocessor. # config.assets.css_compressor = :sass - config.assets.js_compressor = Uglifier.new(harmony: true) + config.assets.js_compressor = :terser # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false