Actually limit SVGGraphics to GENERIC builds (PR 16226 follow-up)

After PR 16226 the deprecated SVG back-end is now unused in development mode, with the exception of unit-tests, hence we can re-factor how it's exposed in the API to avoid including a useless webpack-closure in e.g. the *built-in* Firefox PDF Viewer.
This commit is contained in:
Jonas Jenwald 2023-06-11 12:09:54 +02:00
parent a8d4aad8b9
commit 89f29192a5
2 changed files with 1611 additions and 1640 deletions

File diff suppressed because it is too large Load Diff

View File

@ -69,7 +69,6 @@ import { AnnotationEditorLayer } from "./display/editor/annotation_editor_layer.
import { AnnotationEditorUIManager } from "./display/editor/tools.js";
import { AnnotationLayer } from "./display/annotation_layer.js";
import { GlobalWorkerOptions } from "./display/worker_options.js";
import { SVGGraphics } from "./display/svg.js";
import { XfaLayer } from "./display/xfa_layer.js";
/* eslint-disable-next-line no-unused-vars */
@ -79,6 +78,11 @@ const pdfjsVersion =
const pdfjsBuild =
typeof PDFJSDev !== "undefined" ? PDFJSDev.eval("BUNDLE_BUILD") : void 0;
const SVGGraphics =
typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC")
? require("./display/svg.js").SVGGraphics
: null;
export {
AbortException,
AnnotationEditorLayer,