> UglifyJS only works with ES5. If you need to compress ES6, ruby-terser is a better option. https://github.com/ahorek/terser-ruby
Unified · Split
| @@ -31,7 +31,7 @@ end · 30 unmodified lines | ||
| 31 | 31 | |
| 32 | 32 | group :production do |
| 33 | 33 | gem 'newrelic_rpm' |
| 34 | − gem 'uglifier' | |
| 34 | + gem "terser" | |
| 35 | 35 | end |
| 36 | 36 | |
| 37 | 37 | group :development do |
| @@ -113,6 +113,8 @@ GEM · 112 unmodified lines | ||
| 113 | 113 | strings-ansi (0.2.0) |
| 114 | 114 | terminal-table (3.0.2) |
| 115 | 115 | unicode-display_width (>= 1.1.1, < 3) |
| 116 | + terser (1.1.20) | |
| 117 | + execjs (>= 0.3.0, < 3) | |
| 116 | 118 | thin (1.8.2) |
| 117 | 119 | daemons (~> 1.0, >= 1.0.9) |
| 118 | 120 | eventmachine (~> 1.0, >= 1.0.4) |
| @@ -127,8 +129,6 @@ GEM · 8 unmodified lines | ||
| 127 | 129 | ethon (>= 0.9.0) |
| 128 | 130 | tzinfo (2.0.6) |
| 129 | 131 | concurrent-ruby (~> 1.0) |
| 130 | − uglifier (4.2.0) | |
| 131 | − execjs (>= 0.3.0, < 3) | |
| 132 | 132 | unicode-display_width (2.3.0) |
| 133 | 133 | unicode_utils (1.4.0) |
| 134 | 134 | unix_utils (0.0.15) |
| @@ -166,11 +166,11 @@ DEPENDENCIES · 31 unmodified lines | ||
| 166 | 166 | sprockets-helpers |
| 167 | 167 | sprockets-sass |
| 168 | 168 | terminal-table |
| 169 | + terser | |
| 169 | 170 | thin |
| 170 | 171 | thor |
| 171 | 172 | tty-pager |
| 172 | 173 | typhoeus |
| 173 | − uglifier | |
| 174 | 174 | unix_utils |
| 175 | 175 | yajl-ruby |
| 176 | 176 | |
| @@ -94,7 +94,7 @@ class App < Sinatra::Application · 93 unmodified lines | ||
| 94 | 94 | ['/manifest.json', { 'Cache-Control' => 'public, max-age=86400' }] |
| 95 | 95 | ] |
| 96 | 96 | |
| 97 | − sprockets.js_compressor = Uglifier.new output: { :harmony => true, beautify: true, indent_level: 0 } | |
| 97 | + sprockets.js_compressor = :terser | |
| 98 | 98 | sprockets.css_compressor = :sass |
| 99 | 99 | |
| 100 | 100 | Sprockets::Helpers.configure do |config| |