diff --git a/Gemfile b/Gemfile index cbb3cbc61..dae583420 100644 --- a/Gemfile +++ b/Gemfile @@ -146,6 +146,9 @@ gem "faraday", "~> 1.0" # Needed for getting boundary data into maps gem "rgeo-geojson" +# For compressing javascript +gem "terser" + group :test do gem "capybara" # For some reason upgrading to email_spec 2.2.1 completely breaks things for us diff --git a/Gemfile.lock b/Gemfile.lock index 8ae60c0ee..0facdf7be 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -696,6 +696,8 @@ GEM yard-sorbet terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) + terser (1.2.3) + execjs (>= 0.3.0, < 3) thor (1.3.1) thread_safe (0.3.6) tilt (2.4.0) @@ -854,6 +856,7 @@ DEPENDENCIES sprockets (~> 3.0) tailwindcss-rails (~> 2.0) tapioca + terser timecop typhoeus uglifier diff --git a/config/environments/production.rb b/config/environments/production.rb index fdd4fe148..d46d4476b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -40,7 +40,7 @@ } # Compress JavaScripts and CSS. - config.assets.js_compressor = Uglifier.new(harmony: true) + config.assets.js_compressor = :terser # Compress CSS using a preprocessor. # config.assets.css_compressor = :sass