Skip to content

Commit

Permalink
fix: assets precompile by using terser
Browse files Browse the repository at this point in the history
  • Loading branch information
yksflip committed Jun 8, 2023
1 parent 2e3dc06 commit f139281
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Expand Up @@ -6,7 +6,6 @@ gem 'rails', '~> 7.0'

gem 'less-rails'
gem 'sassc-rails'
gem 'uglifier'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby

Expand Down Expand Up @@ -124,3 +123,5 @@ group :test do
# api
gem 'rswag-specs'
end

gem "terser", "~> 1.1"
6 changes: 3 additions & 3 deletions Gemfile.lock
Expand Up @@ -540,6 +540,8 @@ GEM
sqlite3 (>= 1.3.3)
table_print (1.5.7)
temple (0.9.1)
terser (1.1.13)
execjs (>= 0.3.0, < 3)
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
Expand All @@ -560,8 +562,6 @@ GEM
unf (~> 0.1.0)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
Expand Down Expand Up @@ -674,9 +674,9 @@ DEPENDENCIES
sprockets (< 4)
sqlite3 (~> 1.3.6)
table_print
terser (~> 1.1)
therubyracer
twitter-bootstrap-rails (~> 2.2.8)
uglifier
web-console
whenever

Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Expand Up @@ -29,7 +29,7 @@
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
config.assets.js_compressor = :terser
config.assets.css_compressor = :sass

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

0 comments on commit f139281

Please sign in to comment.