Skip to content

Commit 66d682e

Browse files
committed
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
1 parent a06462f commit 66d682e

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ end
3131

3232
group :production do
3333
gem 'newrelic_rpm'
34-
gem 'uglifier'
34+
gem "terser"
3535
end
3636

3737
group :development do

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ GEM
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
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
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class App < Sinatra::Application
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|

0 commit comments

Comments
 (0)