From 363b5f115455054a3814720aa27a3b60d4b74f91 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Mon, 19 Feb 2024 20:03:12 +0000 Subject: [PATCH] Ignore various fixes in supported features For example, polyfills to fix unhandled empty space characters in ES5 `''.trim()` that would be removed in ES2015 --- packages/govuk-frontend/babel.config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/govuk-frontend/babel.config.js b/packages/govuk-frontend/babel.config.js index c9bd0ad6d2..5154ec54a8 100644 --- a/packages/govuk-frontend/babel.config.js +++ b/packages/govuk-frontend/babel.config.js @@ -49,6 +49,18 @@ module.exports = function (api) { // Browser support polyfills to exclude exclude: [ + // Ignore various fixes in supported features + // https://github.com/zloirock/core-js/blob/v3/packages/core-js-compat/src/data.mjs + 'es.array.includes', + 'es.array.iterator', + 'es.array.push', + 'es.regexp.exec', + 'es.regexp.to-string', + 'es.string.includes', + 'es.string.match', + 'es.string.replace', + 'es.string.trim', + // ES2022 Error cause is unused // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause 'es.error.cause',