Skip to content

Commit

Permalink
Use Terser instead of Uglifier
Browse files Browse the repository at this point in the history
govuk_publishing_components has govuk-frontend as a dependency.

govuk-frontend v5 now targets browsers that support ES6. This means that the UMD modules used in govuk_publsihing_components from govuk-frontend use features of ES6 and so it means that Uglifier can't be used anymore because it only supports ES5.
  • Loading branch information
patrickpatrickpatrick authored and MartinJJones committed May 2, 2024
1 parent 4a8e2a0 commit 36bc9b1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ gem "rinku", require: "rails_rinku"
gem "rss"
gem "slimmer"
gem "sprockets-rails"
gem "uglifier"
gem "terser"

group :development, :test do
gem "govuk_schemas"
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ GEM
domain_name (0.6.20240107)
drb (2.2.1)
erubi (1.12.0)
execjs (2.8.1)
execjs (2.9.1)
faker (3.3.1)
i18n (>= 1.8.11, < 2)
gds-api-adapters (95.1.0)
Expand Down Expand Up @@ -634,13 +634,13 @@ GEM
stringio (3.1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
terser (1.2.2)
execjs (>= 0.3.0, < 3)
thor (1.3.1)
timecop (0.9.8)
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)
webmock (3.23.0)
addressable (>= 2.8.0)
Expand Down Expand Up @@ -692,8 +692,8 @@ DEPENDENCIES
simplecov
slimmer
sprockets-rails
terser
timecop
uglifier
webmock

RUBY VERSION
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?

# Compress JS using a preprocessor.
config.assets.js_compressor = :uglifier
config.assets.js_compressor = :terser

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

0 comments on commit 36bc9b1

Please sign in to comment.