Skip to content

Commit

Permalink
fix: assets precompile by using terser
Browse files Browse the repository at this point in the history
importmaps broke precompiliation with uglifier
see: rails/importmap-rails#5
  • Loading branch information
yksflip committed Jun 8, 2023
1 parent 2e3dc06 commit 16daf32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ source 'https://rubygems.org'
gem 'mail', '~> 2.7.1' # bug with mail 2.8.0 https://github.com/mikel/mail/issues/1489
gem 'rails', '~> 7.0'

gem 'less-rails'
gem 'sassc-rails'
gem 'uglifier'
gem 'less-rails'
# 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 16daf32

Please sign in to comment.