overleaf/services/web/babel.config.json
Alf Eaton 7ad5cb8f8b Exclude Babel's objectSpread and _defineProperty polyfills (#16449)
* Exclude `@babel/plugin-transform-object-rest-spread`
* Exclude `@babel/plugin-transform-computed-properties`

GitOrigin-RevId: 353a830a6c610e2f834e1b5cdd334d3f5ce69b55
2024-01-15 09:04:12 +00:00

30 lines
989 B
JSON

{
"presets": [
[
"@babel/env",
{
"useBuiltIns": "usage",
// This version must be aligned with the `core-js` version in `package.json`
"corejs": { "version": "3.30" },
"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" }],
"@babel/typescript"
],
"plugins": ["angularjs-annotate", "macros"],
"overrides": [
// treat .cjs files (e.g. libraries symlinked into node_modules) as commonjs
{
"test": "../../**/*.cjs",
"sourceType": "script"
}
]
}