mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Remove most build-time require
-calls from the src/display/
-folder
By leveraging import maps we can get rid of *most* of the remaining `require`-calls in the `src/display/`-folder, since we should strive to use modern `import`-statements wherever possible. The only remaining cases are Node.js-specific dependencies, since those seem very difficult to convert unless we start producing a bundle *specifically* for Node.js environments.
This commit is contained in:
parent
e81c084a92
commit
d022912719
11 changed files with 122 additions and 54 deletions
|
@ -39,6 +39,7 @@ import {
|
|||
} from "./display_utils.js";
|
||||
import { AnnotationStorage } from "./annotation_storage.js";
|
||||
import { ColorConverters } from "../shared/scripting_utils.js";
|
||||
import { NullL10n } from "display-l10n_utils";
|
||||
import { XfaLayer } from "./xfa_layer.js";
|
||||
|
||||
const DEFAULT_TAB_INDEX = 1000;
|
||||
|
@ -2872,7 +2873,6 @@ class AnnotationLayer {
|
|||
typeof PDFJSDev !== "undefined" &&
|
||||
PDFJSDev.test("GENERIC && !TESTING")
|
||||
) {
|
||||
const { NullL10n } = require("pdfjs-web/l10n_utils.js");
|
||||
this.l10n ||= NullL10n;
|
||||
}
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue