mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 20:31:34 +02: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:
@@ -32,7 +32,8 @@
|
||||
{
|
||||
"targets": { "node": "12.21" },
|
||||
"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()
|
||||
}
|
||||
|
||||
// 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 disableFontFace = params.get('disable-font-face') === 'true'
|
||||
const cMapUrl = getMeta('ol-pdfCMapsPath')
|
||||
|
||||
Reference in New Issue
Block a user