From 20a67becf5ee24fb7a253799985b07200a54c21c Mon Sep 17 00:00:00 2001 From: Philipp Rothmann Date: Fri, 10 Feb 2023 12:50:59 +0100 Subject: [PATCH] fix: assets precompile by using terser --- Gemfile | 3 ++- Gemfile.lock | 6 +++--- config/environments/production.rb | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 2cda86f3..d8b48a97 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,6 @@ gem 'rails', '~> 7.0' gem 'less-rails' gem 'sassc-rails' -gem 'uglifier' # See https://github.com/sstephenson/execjs#readme for more supported runtimes gem 'therubyracer', platforms: :ruby @@ -124,3 +123,5 @@ group :test do # api gem 'rswag-specs' end + +gem "terser", "~> 1.1" diff --git a/Gemfile.lock b/Gemfile.lock index 3896da95..3a241188 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -540,6 +540,8 @@ GEM sqlite3 (>= 1.3.3) table_print (1.5.7) temple (0.9.1) + terser (1.1.13) + execjs (>= 0.3.0, < 3) therubyracer (0.12.3) libv8 (~> 3.16.14.15) ref @@ -560,8 +562,6 @@ GEM unf (~> 0.1.0) tzinfo (2.0.5) concurrent-ruby (~> 1.0) - uglifier (4.2.0) - execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext unf_ext (0.0.8.2) @@ -674,9 +674,9 @@ DEPENDENCIES sprockets (< 4) sqlite3 (~> 1.3.6) table_print + terser (~> 1.1) therubyracer twitter-bootstrap-rails (~> 2.2.8) - uglifier web-console whenever diff --git a/config/environments/production.rb b/config/environments/production.rb index e1a4e97f..bb846bd7 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -29,7 +29,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 config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed.