mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
[ESM] Convert parseMinified
to use import()
syntax
This commit is contained in:
parent
5696c3aa3a
commit
adfee2a723
1 changed files with 6 additions and 6 deletions
12
gulpfile.js
12
gulpfile.js
|
@ -1122,7 +1122,7 @@ async function parseMinified(dir) {
|
||||||
console.log();
|
console.log();
|
||||||
console.log("### Minifying js files");
|
console.log("### Minifying js files");
|
||||||
|
|
||||||
const Terser = require("terser");
|
const { minify } = await import("terser");
|
||||||
const options = {
|
const options = {
|
||||||
compress: {
|
compress: {
|
||||||
// V8 chokes on very long sequences, work around that.
|
// V8 chokes on very long sequences, work around that.
|
||||||
|
@ -1134,23 +1134,23 @@ async function parseMinified(dir) {
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
dir + "/web/pdf.viewer.js",
|
dir + "/web/pdf.viewer.js",
|
||||||
(await Terser.minify(viewerFiles, options)).code
|
(await minify(viewerFiles, options)).code
|
||||||
);
|
);
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
dir + "/build/pdf.min.js",
|
dir + "/build/pdf.min.js",
|
||||||
(await Terser.minify(pdfFile, options)).code
|
(await minify(pdfFile, options)).code
|
||||||
);
|
);
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
dir + "/build/pdf.worker.min.js",
|
dir + "/build/pdf.worker.min.js",
|
||||||
(await Terser.minify(pdfWorkerFile, options)).code
|
(await minify(pdfWorkerFile, options)).code
|
||||||
);
|
);
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
dir + "/build/pdf.sandbox.min.js",
|
dir + "/build/pdf.sandbox.min.js",
|
||||||
(await Terser.minify(pdfSandboxFile, options)).code
|
(await minify(pdfSandboxFile, options)).code
|
||||||
);
|
);
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
dir + "image_decoders/pdf.image_decoders.min.js",
|
dir + "image_decoders/pdf.image_decoders.min.js",
|
||||||
(await Terser.minify(pdfImageDecodersFile, options)).code
|
(await minify(pdfImageDecodersFile, options)).code
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue