mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
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
This commit is contained in:
parent
35396ab61a
commit
56d826f255
2 changed files with 7 additions and 1 deletions
|
@ -32,7 +32,8 @@
|
||||||
{
|
{
|
||||||
"targets": { "node": "12.21" },
|
"targets": { "node": "12.21" },
|
||||||
"useBuiltIns": "usage",
|
"useBuiltIns": "usage",
|
||||||
"corejs": { "version": 3 }
|
// This version must be aligned with the `core-js` version in `package.json`
|
||||||
|
"corejs": { "version": 3.6 }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
|
@ -11,6 +11,11 @@ if (typeof window !== 'undefined' && 'Worker' in window) {
|
||||||
PDFJS.GlobalWorkerOptions.workerPort = new PDFJSWorker()
|
PDFJS.GlobalWorkerOptions.workerPort = new PDFJSWorker()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// forces the method (required by pdf.js) to be polyfilled by webpack, since
|
||||||
|
// processing pdf.js by webpack/babel causes issues loading documents
|
||||||
|
// eslint-disable-next-line no-unused-expressions
|
||||||
|
Promise.allSettled
|
||||||
|
|
||||||
const params = new URLSearchParams(window.location.search)
|
const params = new URLSearchParams(window.location.search)
|
||||||
const disableFontFace = params.get('disable-font-face') === 'true'
|
const disableFontFace = params.get('disable-font-face') === 'true'
|
||||||
const cMapUrl = getMeta('ol-pdfCMapsPath')
|
const cMapUrl = getMeta('ol-pdfCMapsPath')
|
||||||
|
|
Loading…
Reference in a new issue