From 7ad5cb8f8be79494cd0fdb8b5e85d9d3ae2a077b Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Fri, 12 Jan 2024 10:08:33 +0000 Subject: [PATCH] Exclude Babel's `objectSpread` and `_defineProperty` polyfills (#16449) * Exclude `@babel/plugin-transform-object-rest-spread` * Exclude `@babel/plugin-transform-computed-properties` GitOrigin-RevId: 353a830a6c610e2f834e1b5cdd334d3f5ce69b55 --- services/web/babel.config.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/services/web/babel.config.json b/services/web/babel.config.json index d4da8e595c..086f49eb23 100644 --- a/services/web/babel.config.json +++ b/services/web/babel.config.json @@ -6,8 +6,14 @@ "useBuiltIns": "usage", // This version must be aligned with the `core-js` version in `package.json` "corejs": { "version": "3.30" }, - // Exclude Array.prototype.push polyfill, as it's not needed and affects performance in Chrome - "exclude": ["es.array.push"] + "exclude": [ + // Exclude Array.prototype.push polyfill, as it's not needed and affects performance in Chrome + "es.array.push", + // Exclude objectSpread polyfill, as it's not needed and affects performance + "@babel/plugin-transform-object-rest-spread", + // Exclude _defineProperty polyfill, as it causes a bug without the objectSpread polyfill + "@babel/plugin-transform-computed-properties" + ] } ], ["@babel/react", { "runtime": "automatic" }],