diff --git a/Gemfile b/Gemfile index ebd1162b..f82ec955 100644 --- a/Gemfile +++ b/Gemfile @@ -48,6 +48,7 @@ gem 'slim-rails' gem 'sorcery' # Causes a deprecation warning in Rails 6.0+, see: https://github.com/Sorcery/sorcery/pull/255 gem 'sprockets-rails' gem 'telegraf' +gem 'terser' gem 'tubesock' gem 'turbolinks' gem 'whenever', require: false diff --git a/Gemfile.lock b/Gemfile.lock index e8b9d1be..ff57fdce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -151,6 +151,7 @@ GEM erubi (1.11.0) eventmachine (1.2.7) excon (0.94.0) + execjs (2.8.1) factory_bot (6.2.1) activesupport (>= 5.0.0) factory_bot_rails (6.2.0) @@ -488,6 +489,8 @@ GEM telegraf (2.1.1) influxdb temple (0.8.2) + terser (1.1.12) + execjs (>= 0.3.0, < 3) thor (1.2.1) tilt (2.0.11) timeout (0.3.0) @@ -609,6 +612,7 @@ DEPENDENCIES sorcery sprockets-rails telegraf + terser tubesock turbolinks web-console diff --git a/config/environments/production.rb b/config/environments/production.rb index b3cc3371..3b6f9b56 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -28,7 +28,10 @@ Rails.application.configure do config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? # Compress CSS using a preprocessor. - # config.assets.css_compressor = :sass + config.assets.css_compressor = :sass + + # Compress JavaScript using a preprocessor. + config.assets.js_compressor = :terser # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false