mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
JS - Add the basic architecture to be able to execute embedded js
This commit is contained in:
parent
a373137304
commit
e76a96892a
18 changed files with 823 additions and 0 deletions
20
gulpfile.js
20
gulpfile.js
|
@ -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")
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue