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 Mar 5, 2023
1 parent 2d08edf commit 1834c39
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ gem "rails", '~> 5.2'

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

Expand Down Expand Up @@ -121,3 +120,5 @@ group :test do
end

gem "importmap-rails", "~> 1.1"

gem "terser", "~> 1.1"
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,9 @@ GEM
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
table_print (1.5.7)
temple (0.8.2)
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 @@ -525,10 +527,8 @@ GEM
railties (>= 3.1)
twitter-text (1.14.7)
unf (~> 0.1.0)
tzinfo (1.2.10)
thread_safe (~> 0.1)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
Expand Down Expand Up @@ -639,9 +639,9 @@ DEPENDENCIES
sprockets (< 4)
sqlite3 (~> 1.3.6)
table_print
terser (~> 1.1)
therubyracer
twitter-bootstrap-rails (~> 2.2.8)
uglifier (>= 1.0.3)
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 @@ -27,7 +27,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 1834c39

Please sign in to comment.