JS - Add the basic architecture to be able to execute embedded js

This commit is contained in:
Calixte Denizet 2020-10-01 13:57:23 +02:00
parent a373137304
commit e76a96892a
18 changed files with 823 additions and 0 deletions

View file

@ -316,6 +316,23 @@ function createMainBundle(defines) {
.pipe(replaceJSRootName(mainAMDName, "pdfjsLib"));
}
function createScriptingBundle(defines) {
var mainAMDName = "pdfjs-dist/build/pdf.scripting";
var mainOutputName = "pdf.scripting.js";
var mainFileConfig = createWebpackConfig(defines, {
filename: mainOutputName,
library: mainAMDName,
libraryTarget: "umd",
umdNamedDefine: true,
});
return gulp
.src("./src/scripting_api/initialization.js")
.pipe(webpack2Stream(mainFileConfig))
.pipe(replaceWebpackRequire())
.pipe(replaceJSRootName(mainAMDName, "pdfjsScripting"));
}
function createWorkerBundle(defines) {
var workerAMDName = "pdfjs-dist/build/pdf.worker";
var workerOutputName = "pdf.worker.js";
@ -1036,6 +1053,9 @@ gulp.task(
createMainBundle(defines).pipe(
gulp.dest(MOZCENTRAL_CONTENT_DIR + "build")
),
createScriptingBundle(defines).pipe(
gulp.dest(MOZCENTRAL_CONTENT_DIR + "build")
),
createWorkerBundle(defines).pipe(
gulp.dest(MOZCENTRAL_CONTENT_DIR + "build")
),