Skip to content

Commit e5ebecd

Browse files
Exclude polyfills for DOM collection iteration
Although these polyfills are required to iterate DOM collections, we always use `Array.from()` so don’t need them: ``` The corejs3 polyfill added the following polyfills: es.array.iterator { "chrome":"61", "opera":"48", "samsung":"8.2" } web.dom-collections.iterator { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" } ```
1 parent f25f11c commit e5ebecd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/govuk-frontend/babel.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ module.exports = function (api) {
5353
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause
5454
'es.error.cause',
5555

56+
// DOM collection iteration is unnecessary with `Array.from()`
57+
// see https://github.com/zloirock/core-js/issues/1003
58+
'web.dom-collections.iterator',
59+
5660
// WHATWG URL constructor `undefined` base fix is unnecessary
5761
// https://bugs.webkit.org/show_bug.cgi?id=216841
5862
// https://github.com/zloirock/core-js/commit/0ef4be7352e900dfa6f1eda27de22f7974576531

0 commit comments

Comments
 (0)