Don't bundle the FakeMLManager class in regular builds
Given that this functionality is only used in the development viewer and in TESTING builds, there's no reason to include this in the regular builds.
This commit is contained in:
parent
50c573d16d
commit
b5ac96da19
@ -53,6 +53,12 @@ class ExternalServices extends BaseExternalServices {
|
||||
}
|
||||
|
||||
class MLManager {
|
||||
static {
|
||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING")) {
|
||||
this.getFakeMLManager = options => new FakeMLManager(options);
|
||||
}
|
||||
}
|
||||
|
||||
async isEnabledFor(_name) {
|
||||
return false;
|
||||
}
|
||||
@ -68,13 +74,11 @@ class MLManager {
|
||||
guess(_data) {}
|
||||
|
||||
toggleService(_name, _enabled) {}
|
||||
|
||||
static getFakeMLManager(options) {
|
||||
return new FakeMLManager(options);
|
||||
}
|
||||
}
|
||||
|
||||
class FakeMLManager {
|
||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING")) {
|
||||
// eslint-disable-next-line no-var
|
||||
var FakeMLManager = class {
|
||||
eventBus = null;
|
||||
|
||||
hasProgress = false;
|
||||
@ -145,6 +149,7 @@ class FakeMLManager {
|
||||
toggleService(_name, enabled) {
|
||||
this.enableGuessAltText = enabled;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export { ExternalServices, initCom, MLManager, Preferences };
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user