Re-implement working dev-sandbox/watch-dev-sandbox gulp-tasks

Compared to the, previously removed, `sandbox`/`watch-sandbox` gulp-tasks, these ones should work even when run against an non-existent/empty `build`-folder.

Also, to ensure that the development viewer actually works out-of-the-box, `gulp server` will now also include `gulp watch-dev-sandbox` to remove the need to *manually* invoke the build-tasks.

Finally, this patch also removes the `web/devcom.js` file since it shouldn't actually be needed, assuming that the "sandbox"-loading code in the `web/genericcom.js` file is actually *correctly* implemented.
This commit is contained in:
Jonas Jenwald 2020-12-05 15:51:39 +01:00
parent 13d7244529
commit c39f1aedb2
5 changed files with 67 additions and 65 deletions

View file

@ -223,14 +223,6 @@ const defaultOptions = {
value: false,
kind: OptionKind.API,
},
scriptingSrc: {
/** @type {string} */
value:
typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")
? "../build/generic/build/pdf.sandbox.js"
: "../build/pdf.sandbox.js",
kind: OptionKind.VIEWER,
},
verbosity: {
/** @type {number} */
value: 1,
@ -265,6 +257,14 @@ if (
value: typeof navigator !== "undefined" ? navigator.language : "en-US",
kind: OptionKind.VIEWER,
};
defaultOptions.sandboxBundleSrc = {
/** @type {string} */
value:
typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")
? "../build/dev-sandbox/pdf.sandbox.js"
: "../build/pdf.sandbox.js",
kind: OptionKind.VIEWER,
};
}
const userOptions = Object.create(null);