aab0f91740
For performance reasons, and to avoid hanging the browser UI, the PDF.js library should *always* be used with web workers enabled. At this point in time all of the supported browsers should have proper worker support, and Node.js is thus the only environment where workers aren't supported. Hence it no longer seems relevant/necessary to provide, by default, fake worker loaders for various JS builders/bundlers/frameworks in the PDF.js code itself.[1] In order to simplify things, the fake worker loader code is thus simplified to now *only* support Node.js usage respectively "normal" browser usage out-of-the-box.[2] *Please note:* The officially intended way of using the PDF.js library is with workers enabled, which can be done by setting `GlobalWorkerOptions.workerSrc`, `GlobalWorkerOptions.workerPort`, or manually providing a `PDFWorker` instance when calling `getDocument`. --- [1] Note that it's still possible to *manually* disable workers, simply my manually loading the built `pdf.worker.js` file into the (current) global scope, however this's mostly intended for testing/debugging purposes. [2] Unfortunately some bundlers such as Webpack, when used with third-party deployments of the PDF.js library, will start to print `Critical dependency: ...` warnings when run against the built `pdf.js` file from this patch. The reason is that despite the `require` calls being protected by *runtime* `isNodeJS` checks, it's not possible to simply tell Webpack to just ignore the `require`; please see [Webpack issue 8826](https://github.com/webpack/webpack) and libraries such as [require-fool-webpack](https://github.com/sindresorhus/require-fool-webpack).
64 lines
1.7 KiB
JSON
64 lines
1.7 KiB
JSON
{
|
|
"name": "pdf.js",
|
|
"version": "2.0.0",
|
|
"devDependencies": {
|
|
"@babel/core": "^7.7.7",
|
|
"@babel/plugin-transform-modules-commonjs": "^7.7.5",
|
|
"@babel/plugin-transform-runtime": "^7.7.6",
|
|
"@babel/preset-env": "^7.7.7",
|
|
"@babel/runtime": "^7.7.7",
|
|
"acorn": "^6.4.0",
|
|
"autoprefixer": "^9.7.3",
|
|
"babel-loader": "^8.0.6",
|
|
"canvas": "^2.6.0",
|
|
"core-js": "^3.6.0",
|
|
"escodegen": "^1.12.0",
|
|
"eslint": "^6.7.2",
|
|
"eslint-config-prettier": "^6.7.0",
|
|
"eslint-plugin-fetch-options": "^0.0.5",
|
|
"eslint-plugin-html": "^6.0.0",
|
|
"eslint-plugin-import": "^2.19.1",
|
|
"eslint-plugin-mozilla": "^2.3.1",
|
|
"eslint-plugin-no-unsanitized": "^3.0.2",
|
|
"eslint-plugin-prettier": "^3.1.2",
|
|
"eslint-plugin-unicorn": "^10.0.0",
|
|
"fancy-log": "^1.3.3",
|
|
"globals": "^11.12.0",
|
|
"gulp": "^4.0.2",
|
|
"gulp-postcss": "^8.0.0",
|
|
"gulp-rename": "^1.4.0",
|
|
"gulp-replace": "^1.0.0",
|
|
"gulp-zip": "^4.2.0",
|
|
"jasmine": "^3.5.0",
|
|
"jasmine-core": "^3.5.0",
|
|
"jsdoc": "^3.6.3",
|
|
"jstransformer-markdown-it": "^2.1.0",
|
|
"merge-stream": "^1.0.1",
|
|
"mkdirp": "^0.5.1",
|
|
"prettier": "^1.19.1",
|
|
"rimraf": "^2.7.1",
|
|
"streamqueue": "^1.1.2",
|
|
"systemjs": "^0.21.6",
|
|
"systemjs-plugin-babel": "^0.0.25",
|
|
"terser": "^4.4.3",
|
|
"through2": "^3.0.1",
|
|
"ttest": "^2.1.0",
|
|
"typogr": "^0.6.8",
|
|
"vinyl": "^2.2.0",
|
|
"vinyl-fs": "^3.0.3",
|
|
"web-streams-polyfill": "^2.0.6",
|
|
"webpack": "^4.41.4",
|
|
"webpack-stream": "^4.0.3",
|
|
"wintersmith": "^2.5.0",
|
|
"yargs": "^11.1.1"
|
|
},
|
|
"scripts": {
|
|
"test": "env SKIP_BABEL=true gulp npm-test"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git://github.com/mozilla/pdf.js.git"
|
|
},
|
|
"license": "Apache-2.0"
|
|
}
|