Skip to content

Commit 07a1f9f

Browse files
committed
replace uglifier gem by terser to minimize javascript files
The minimization of JavaScript files is useful, because LinuxFr.org includes jQuery and jQeury UI and certainly don't use all the tools provided by them. The decaffeinate process to build JavaScript files from old coffee script files has built EcmaScript 6 files. As uglifier is not compatible with EcmaScript 6, it has been replaced by terser which is recommended by the uglifier project itself.
1 parent a36e960 commit 07a1f9f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ assets = true if ENV['RAILS_GROUPS'] == "assets"
4141
gem "jquery-rails", "~>4.0", require: assets
4242
gem "normalize-rails", "~>8.0", require: assets
4343
gem "sass-rails", "~>5.0", require: assets
44-
gem "uglifier", require: assets
44+
gem "terser", "~> 1.2", require: assets
4545

4646
group :development, :test do
4747
# Call 'byebug' anywhere in the code to stop execution and get a debugger console

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,13 @@ GEM
359359
state_machines-activemodel (>= 0.9.0)
360360
stringio (3.1.0)
361361
temple (0.10.3)
362+
terser (1.2.0)
363+
execjs (>= 0.3.0, < 3)
362364
thor (1.3.1)
363365
tilt (2.3.0)
364366
timeout (0.4.1)
365367
tzinfo (2.0.6)
366368
concurrent-ruby (~> 1.0)
367-
uglifier (4.2.0)
368-
execjs (>= 0.3.0, < 3)
369369
unicorn (6.1.0)
370370
kgio (~> 2.6)
371371
raindrops (~> 0.7)
@@ -426,7 +426,7 @@ DEPENDENCIES
426426
sitemap_generator (~> 2.1)
427427
spring
428428
state_machines-activerecord
429-
uglifier
429+
terser (~> 1.2)
430430
unicorn (~> 6.1)
431431
web-console
432432

config/environments/alpha.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
2222

2323
# Compress JavaScripts and CSS.
24-
config.assets.js_compressor = :uglifier
24+
config.assets.js_compressor = :terser
2525
config.assets.css_compressor = :sass
2626

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

config/environments/production.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
2727

2828
# Compress CSS using a preprocessor.
29-
config.assets.js_compressor = :uglifier
29+
config.assets.js_compressor = :terser
3030
config.assets.css_compressor = :sass
3131

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

0 commit comments

Comments
 (0)