> 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 | group :production do | 32 | group :production do |
| 33 | gem 'newrelic_rpm' | 33 | gem 'newrelic_rpm' |
| 34 | gem 'uglifier' | 34 | gem "terser" |
| 35 | end | 35 | end |
| 36 | 36 | ||
| 37 | group :development do | 37 | group :development do |
| @@ -113,6 +113,8 @@ GEM · 112 unmodified lines | |||
| 113 | strings-ansi (0.2.0) | 113 | strings-ansi (0.2.0) |
| 114 | terminal-table (3.0.2) | 114 | terminal-table (3.0.2) |
| 115 | unicode-display_width (>= 1.1.1, < 3) | 115 | unicode-display_width (>= 1.1.1, < 3) |
| 116 | terser (1.1.20) | ||
| 117 | execjs (>= 0.3.0, < 3) | ||
| 116 | thin (1.8.2) | 118 | thin (1.8.2) |
| 117 | daemons (~> 1.0, >= 1.0.9) | 119 | daemons (~> 1.0, >= 1.0.9) |
| 118 | eventmachine (~> 1.0, >= 1.0.4) | 120 | eventmachine (~> 1.0, >= 1.0.4) |
| @@ -127,8 +129,6 @@ GEM · 8 unmodified lines | |||
| 127 | ethon (>= 0.9.0) | 129 | ethon (>= 0.9.0) |
| 128 | tzinfo (2.0.6) | 130 | tzinfo (2.0.6) |
| 129 | concurrent-ruby (~> 1.0) | 131 | concurrent-ruby (~> 1.0) |
| 130 | uglifier (4.2.0) | ||
| 131 | execjs (>= 0.3.0, < 3) | ||
| 132 | unicode-display_width (2.3.0) | 132 | unicode-display_width (2.3.0) |
| 133 | unicode_utils (1.4.0) | 133 | unicode_utils (1.4.0) |
| 134 | unix_utils (0.0.15) | 134 | unix_utils (0.0.15) |
| @@ -166,11 +166,11 @@ DEPENDENCIES · 31 unmodified lines | |||
| 166 | sprockets-helpers | 166 | sprockets-helpers |
| 167 | sprockets-sass | 167 | sprockets-sass |
| 168 | terminal-table | 168 | terminal-table |
| 169 | terser | ||
| 169 | thin | 170 | thin |
| 170 | thor | 171 | thor |
| 171 | tty-pager | 172 | tty-pager |
| 172 | typhoeus | 173 | typhoeus |
| 173 | uglifier | ||
| 174 | unix_utils | 174 | unix_utils |
| 175 | yajl-ruby | 175 | yajl-ruby |
| 176 | 176 | ||
| @@ -94,7 +94,7 @@ class App < Sinatra::Application · 93 unmodified lines | |||
| 94 | ['/manifest.json', { 'Cache-Control' => 'public, max-age=86400' }] | 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 | sprockets.css_compressor = :sass | 98 | sprockets.css_compressor = :sass |
| 99 | 99 | ||
| 100 | Sprockets::Helpers.configure do |config| | 100 | Sprockets::Helpers.configure do |config| |