diff --git a/packages/govuk-frontend/babel.config.js b/packages/govuk-frontend/babel.config.js index 37f484e5c1..63d6bb102f 100644 --- a/packages/govuk-frontend/babel.config.js +++ b/packages/govuk-frontend/babel.config.js @@ -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'