overleaf/services/web/babel.config.json
Miguel Serrano 56d826f255 Force Promise.allSettled polyfill (#6192)
* Force `Promise.allSettled` polyfill

`Promise.allSettled` is required by `pdf.js`, but the polyfill is not available in the bundle. This forces babel to include the polyfill without having to process `pdf.js` with webpack/babel, which causes issues loading documents.

* Updated core.js version for test config

GitOrigin-RevId: 981da187352ffc8c59cb77ba55a0a9643bd7cc9a
2022-01-12 09:04:06 +00:00

42 lines
912 B
JSON

{
"presets": [
[
"@babel/react",
{
"runtime": "automatic"
}
],
[
"@babel/env",
{
"useBuiltIns": "usage",
// This version must be aligned with the `core-js` version in `package.json`
"corejs": { "version": 3.6 }
}
]
],
"plugins": ["angularjs-annotate", "macros"],
// Target our current Node version in test environment, to transform and
// polyfill only what's necessary
"env": {
"test": {
"presets": [
[
"@babel/react",
{
"runtime": "automatic"
}
],
[
"@babel/env",
{
"targets": { "node": "12.21" },
"useBuiltIns": "usage",
// This version must be aligned with the `core-js` version in `package.json`
"corejs": { "version": 3.6 }
}
]
]
}
}
}