Skip to content

Commit

Permalink
Use terser for js compression
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Jul 31, 2024
1 parent 702e94a commit ed380b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ gem "faraday", "~> 1.0"
# Needed for getting boundary data into maps
gem "rgeo-geojson"

# For compressing javascript
gem "terser"

group :test do
gem "capybara"
# For some reason upgrading to email_spec 2.2.1 completely breaks things for us
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,8 @@ GEM
yard-sorbet
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
terser (1.2.3)
execjs (>= 0.3.0, < 3)
thor (1.3.1)
thread_safe (0.3.6)
tilt (2.4.0)
Expand Down Expand Up @@ -854,6 +856,7 @@ DEPENDENCIES
sprockets (~> 3.0)
tailwindcss-rails (~> 2.0)
tapioca
terser
timecop
typhoeus
uglifier
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}

# Compress JavaScripts and CSS.
config.assets.js_compressor = Uglifier.new(harmony: true)
config.assets.js_compressor = :terser

# Compress CSS using a preprocessor.
# config.assets.css_compressor = :sass
Expand Down

0 comments on commit ed380b7

Please sign in to comment.