Skip to content

Commit

Permalink
Prevent JS minifier making unsafe polyfill changes
Browse files Browse the repository at this point in the history
We’re seeing the `addEventListener` polyfill not applied in IE8 when UglifyJS `inline` optimisations above level 2 (no variables or statements) are added

https://github.com/mishoo/UglifyJS#compress-options
  • Loading branch information
colinrotherham committed Jan 9, 2023
1 parent 32946b6 commit cf79eeb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tasks/compile-javascripts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ export function minifyJavaScript (modulePath, result) {
includeSources: true
},

// Prevent unsafe polyfill changes
// https://github.com/mishoo/UglifyJS#compress-options
compress: {
inline: 2
},

// Compatibility workarounds
ie8: true,
module: false,
Expand Down

0 comments on commit cf79eeb

Please sign in to comment.