Merge pull request #19337 from Snuffleupagus/dev-wasm
Support multiple wasm-files in the development viewer
This commit is contained in:
commit
79a976ce9d
26
gulpfile.mjs
26
gulpfile.mjs
@ -650,10 +650,12 @@ function createStandardFontBundle() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createWasmBundle() {
|
function createWasmBundle() {
|
||||||
return gulp.src(["external/openjpeg/openjpeg.wasm"], {
|
return ordered([
|
||||||
base: "external/openjpeg",
|
gulp.src(["external/openjpeg/*.wasm"], {
|
||||||
encoding: false,
|
base: "external/openjpeg",
|
||||||
});
|
encoding: false,
|
||||||
|
}),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkFile(filePath) {
|
function checkFile(filePath) {
|
||||||
@ -2077,6 +2079,15 @@ gulp.task(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
gulp.task("dev-wasm", function () {
|
||||||
|
const VIEWER_WASM_OUTPUT = "web/wasm/";
|
||||||
|
|
||||||
|
fs.rmSync(VIEWER_WASM_OUTPUT, { recursive: true, force: true });
|
||||||
|
fs.mkdirSync(VIEWER_WASM_OUTPUT, { recursive: true });
|
||||||
|
|
||||||
|
return createWasmBundle().pipe(gulp.dest(VIEWER_WASM_OUTPUT));
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task(
|
gulp.task(
|
||||||
"dev-sandbox",
|
"dev-sandbox",
|
||||||
gulp.series(
|
gulp.series(
|
||||||
@ -2112,6 +2123,13 @@ gulp.task(
|
|||||||
gulp.series("locale")
|
gulp.series("locale")
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
function watchWasm() {
|
||||||
|
gulp.watch(
|
||||||
|
"external/openjpeg/*",
|
||||||
|
{ ignoreInitial: false },
|
||||||
|
gulp.series("dev-wasm")
|
||||||
|
);
|
||||||
|
},
|
||||||
function watchDevSandbox() {
|
function watchDevSandbox() {
|
||||||
gulp.watch(
|
gulp.watch(
|
||||||
[
|
[
|
||||||
|
|||||||
2
web/.gitignore
vendored
2
web/.gitignore
vendored
@ -1,3 +1,3 @@
|
|||||||
locale.properties
|
|
||||||
locale/
|
locale/
|
||||||
cmaps/
|
cmaps/
|
||||||
|
wasm/
|
||||||
|
|||||||
@ -434,12 +434,9 @@ const defaultOptions = {
|
|||||||
wasmUrl: {
|
wasmUrl: {
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
value:
|
value:
|
||||||
// eslint-disable-next-line no-nested-ternary
|
typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")
|
||||||
typeof PDFJSDev === "undefined"
|
? "resource://pdf.js/web/wasm/"
|
||||||
? "../external/openjpeg/"
|
: "../web/wasm/",
|
||||||
: PDFJSDev.test("MOZCENTRAL")
|
|
||||||
? "resource://pdf.js/web/wasm/"
|
|
||||||
: "../web/wasm/",
|
|
||||||
kind: OptionKind.API,
|
kind: OptionKind.API,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user