Skip to content

Commit

Permalink
rails71: uglifier を terser-ruby に置き換える
Browse files Browse the repository at this point in the history
アセットプリコンパイル時に JavaScript のコンパイルができなくなっていたため
  • Loading branch information
koi-chan committed Feb 2, 2024
1 parent e6c3040 commit 3f4764b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ gem 'activerecord-import'

# Use SCSS for stylesheets
gem 'sassc-rails', '>= 2.1'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3'
# Use Terser as compressor for JavaScript assets
gem 'terser'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ GEM
sprockets (>= 3.0.0)
stringio (3.1.0)
sysexits (1.2.0)
terser (1.2.0)
execjs (>= 0.3.0, < 3)
test-unit (3.6.1)
power_assert
test-unit-activesupport (1.1.1)
Expand All @@ -410,8 +412,6 @@ GEM
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.5.0)
uri (0.13.0)
version_gem (1.1.3)
Expand Down Expand Up @@ -479,8 +479,8 @@ DEPENDENCIES
sorcery
sprockets-rails
sysexits
terser
test-unit-rails
uglifier (>= 1.3)
web-console (~> 4.0)
xmlrpc

Expand Down
3 changes: 2 additions & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
# config.public_file_server.enabled = false

# Compress CSS using a preprocessor.
config.assets.js_compressor = :uglifier
config.assets.js_compressor = :terser
config.assets.terser = { output: { ascii_only: false } }
# config.assets.css_compressor = :sass

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

0 comments on commit 3f4764b

Please sign in to comment.