Use globalThis for webpack's output.globalObject instead of this. Close #14915.

That allows us to import pdfjs-dist/build/pdf.js dynamically from modules.

- https://webpack.js.org/configuration/output/#outputglobalobject
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis
This commit is contained in:
Takashi Tamura 2022-05-14 17:02:06 +09:00
parent 9bdf27e8e0
commit 10932e3f9d

View File

@ -230,7 +230,7 @@ function createWebpackConfig(
} }
// Required to expose e.g., the `window` object. // Required to expose e.g., the `window` object.
output.globalObject = "this"; output.globalObject = "globalThis";
return { return {
mode: "none", mode: "none",