Skip to content

Commit

Permalink
use terser rather than uglifier
Browse files Browse the repository at this point in the history
Uglifier(harmony: true) fails; :uglifier does not suit for ES6

See: lautis/uglifier#185
  • Loading branch information
nicolas-entourage committed Apr 24, 2023
1 parent 75bacab commit 99dc2fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ gem 'rails', '~> 6.0'

gem 'sass-rails'
gem 'uglifier'
gem 'terser'
gem 'jquery-rails', '~> 4'
gem 'jquery-ui-rails', '~> 5'
gem 'turbolinks', '~> 5'
Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,11 @@ GEM
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
libdatadog (2.0.0.1.0)
libdatadog (2.0.0.1.0-x86_64-linux)
libddwaf (1.6.2.0.0)
ffi (~> 1.0)
libddwaf (1.6.2.0.0-x86_64-linux)
ffi (~> 1.0)
lograge (0.12.0)
actionpack (>= 4)
activesupport (>= 4)
Expand Down Expand Up @@ -279,6 +282,8 @@ GEM
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.14.3-x86_64-linux)
racc (~> 1.4)
optimist (3.0.1)
parallel (1.23.0)
parser (3.2.2.0)
Expand Down Expand Up @@ -451,6 +456,8 @@ GEM
attr_extras (>= 6.2.4)
diff-lcs
patience_diff
terser (1.1.14)
execjs (>= 0.3.0, < 3)
thor (1.2.1)
tilt (2.1.0)
timecop (0.9.6)
Expand Down Expand Up @@ -552,6 +559,7 @@ DEPENDENCIES
spring (~> 2.1.0)
spring-commands-rspec
super_diff
terser
timecop
tinymce-rails
turbolinks (~> 5)
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

# Compress JavaScripts and CSS.
config.assets.js_compressor = Uglifier.new(harmony: true)
config.assets.js_compressor = :terser
# config.assets.css_compressor = :sass

# Do not fallback to assets pipeline if a precompiled asset is missed.
Expand Down

0 comments on commit 99dc2fb

Please sign in to comment.