Skip to content

Commit

Permalink
Exclude polyfill for ES2022 Error cause
Browse files Browse the repository at this point in the history
Although this polyfill is required for feature complete Error support, we don’t use the `.cause` property yet

```
The es-shims polyfill added the following polyfills:
  Error cause { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
```
  • Loading branch information
colinrotherham committed Oct 31, 2023
1 parent 0eeef94 commit 701b232
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/govuk-frontend/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ module.exports = function (api) {
// Add logging for required polyfills
debug: isProduction,

// Browser support polyfills to exclude
exclude: [
// ES2022 Error cause is unused
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause
'Error cause'
],

// Replace unsupported code with polyfills
// without modifying window globals
method: 'usage-pure'
Expand Down

0 comments on commit 701b232

Please sign in to comment.