Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include image_decoders-es5/minified-es5 in the pdfjs-dist library (issue 12220) #12227

Merged
merged 2 commits into from
Aug 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ var GENERIC_DIR = BUILD_DIR + "generic/";
var GENERIC_ES5_DIR = BUILD_DIR + "generic-es5/";
var COMPONENTS_DIR = BUILD_DIR + "components/";
var COMPONENTS_ES5_DIR = BUILD_DIR + "components-es5/";
var IMAGE_DECODERS_DIR = BUILD_DIR + "image_decoders";
var IMAGE_DECODERS_DIR = BUILD_DIR + "image_decoders/";
var IMAGE_DECODERS_ES5_DIR = BUILD_DIR + "image_decoders-es5/";
var DEFAULT_PREFERENCES_DIR = BUILD_DIR + "default_preferences/";
var MINIFIED_DIR = BUILD_DIR + "minified/";
var MINIFIED_ES5_DIR = BUILD_DIR + "minified-es5/";
Expand Down Expand Up @@ -829,6 +830,23 @@ gulp.task(
})
);

gulp.task(
"image_decoders-es5",
gulp.series("buildnumber", function () {
console.log();
console.log("### Creating (ES5) image decoders");
var defines = builder.merge(DEFINES, {
GENERIC: true,
IMAGE_DECODERS: true,
SKIP_BABEL: false,
});

return createImageDecodersBundle(defines).pipe(
gulp.dest(IMAGE_DECODERS_ES5_DIR)
);
})
);

function buildMinified(defines, dir) {
rimraf.sync(dir);

Expand Down Expand Up @@ -1694,8 +1712,10 @@ gulp.task(
"components",
"components-es5",
"image_decoders",
"image_decoders-es5",
"lib",
"minified",
"minified-es5",
"types",
function () {
console.log();
Expand Down Expand Up @@ -1752,6 +1772,18 @@ gulp.task(
.src(MINIFIED_DIR + "image_decoders/pdf.image_decoders.js")
.pipe(rename("pdf.image_decoders.min.js"))
.pipe(gulp.dest(DIST_DIR + "image_decoders/")),
gulp
.src(MINIFIED_ES5_DIR + "build/pdf.js")
.pipe(rename("pdf.min.js"))
.pipe(gulp.dest(DIST_DIR + "es5/build/")),
gulp
.src(MINIFIED_ES5_DIR + "build/pdf.worker.js")
.pipe(rename("pdf.worker.min.js"))
.pipe(gulp.dest(DIST_DIR + "es5/build/")),
gulp
.src(MINIFIED_ES5_DIR + "image_decoders/pdf.image_decoders.js")
.pipe(rename("pdf.image_decoders.min.js"))
.pipe(gulp.dest(DIST_DIR + "es5/image_decoders/")),
gulp
.src(COMPONENTS_DIR + "**/*", { base: COMPONENTS_DIR })
.pipe(gulp.dest(DIST_DIR + "web/")),
Expand All @@ -1760,7 +1792,12 @@ gulp.task(
.pipe(gulp.dest(DIST_DIR + "es5/web/")),
gulp
.src(IMAGE_DECODERS_DIR + "**/*", { base: IMAGE_DECODERS_DIR })
.pipe(gulp.dest(DIST_DIR + "image_decoders")),
.pipe(gulp.dest(DIST_DIR + "image_decoders/")),
gulp
.src(IMAGE_DECODERS_ES5_DIR + "**/*", {
base: IMAGE_DECODERS_ES5_DIR,
})
.pipe(gulp.dest(DIST_DIR + "es5/image_decoders/")),
gulp
.src(LIB_DIR + "**/*", { base: LIB_DIR })
.pipe(gulp.dest(DIST_DIR + "lib/")),
Expand Down