Use Terser instead of Uglifier to compile JavaScript.
Why
This change is preparation for upgrading to V5 of govuk-frontend in the govuk-publishing-components gem.
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.
What
Use Terser instead of Uglifier to compile JavaScript.
Why
This change is preparation for upgrading to V5 of govuk-frontend in the govuk-publishing-components gem.
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.
Trello card
Further info
JS Size
Browser testing
I've tested the changes on Integration using the browsers below, functionality works as expected without any console errors.