mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
8cba7935b7
[overleaf-editor-core] remove Node.js stdlib import and tweak babel config GitOrigin-RevId: 2ac13cc17651a3b522606f8df23c7e6915be19a6
42 lines
1.5 KiB
JSON
42 lines
1.5 KiB
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",
|
|
// Use native async functions, for performance
|
|
"@babel/plugin-transform-async-to-generator",
|
|
// Use native generators, for performance
|
|
"@babel/plugin-transform-regenerator",
|
|
// Use native async generators, for performance
|
|
"@babel/plugin-transform-async-generator-functions",
|
|
// Use native for-of loops, for performance
|
|
"@babel/plugin-transform-for-of"
|
|
]
|
|
}
|
|
],
|
|
["@babel/react", { "runtime": "automatic" }],
|
|
"@babel/typescript"
|
|
],
|
|
"plugins": ["macros"],
|
|
"overrides": [
|
|
// treat .cjs files (e.g. libraries symlinked into node_modules) as commonjs
|
|
{
|
|
"test": "../../**/*.cjs",
|
|
"sourceType": "script"
|
|
},
|
|
{
|
|
"test": "../../libraries/overleaf-editor-core/**/*.js",
|
|
"sourceType": "script"
|
|
}
|
|
]
|
|
}
|