History

Replace uglifier with terser

> UglifyJS only works with ES5. If you need to compress ES6, ruby-terser is a better option. https://github.com/ahorek/terser-ruby

Simon Legner committed 2 years ago

Commit 66d682e1 parent a06462f3 files · +5 −5Browse files

Unified · Split

3 files
  1. Gemfile +1 −1
  2. Gemfile.lock +3 −3
  3. lib/app.rb +1 −1
Gemfile+1−1
@@ -31,7 +31,7 @@ end · 30 unmodified lines
3131
3232 group :production do
3333 gem 'newrelic_rpm'
34− gem 'uglifier'
34+ gem "terser"
3535 end
3636
3737 group :development do
Gemfile.lock+3−3
@@ -113,6 +113,8 @@ GEM · 112 unmodified lines
113113 strings-ansi (0.2.0)
114114 terminal-table (3.0.2)
115115 unicode-display_width (>= 1.1.1, < 3)
116+ terser (1.1.20)
117+ execjs (>= 0.3.0, < 3)
116118 thin (1.8.2)
117119 daemons (~> 1.0, >= 1.0.9)
118120 eventmachine (~> 1.0, >= 1.0.4)
@@ -127,8 +129,6 @@ GEM · 8 unmodified lines
127129 ethon (>= 0.9.0)
128130 tzinfo (2.0.6)
129131 concurrent-ruby (~> 1.0)
130− uglifier (4.2.0)
131− execjs (>= 0.3.0, < 3)
132132 unicode-display_width (2.3.0)
133133 unicode_utils (1.4.0)
134134 unix_utils (0.0.15)
@@ -166,11 +166,11 @@ DEPENDENCIES · 31 unmodified lines
166166 sprockets-helpers
167167 sprockets-sass
168168 terminal-table
169+ terser
169170 thin
170171 thor
171172 tty-pager
172173 typhoeus
173− uglifier
174174 unix_utils
175175 yajl-ruby
176176
lib/app.rb+1−1
@@ -94,7 +94,7 @@ class App < Sinatra::Application · 93 unmodified lines
9494 ['/manifest.json', { 'Cache-Control' => 'public, max-age=86400' }]
9595 ]
9696
97− sprockets.js_compressor = Uglifier.new output: { :harmony => true, beautify: true, indent_level: 0 }
97+ sprockets.js_compressor = :terser
9898 sprockets.css_compressor = :sass
9999
100100 Sprockets::Helpers.configure do |config|