pdf.js/package.json
Nicolò Ribaudo f724ae98a1
Replace the webpack+acorn transform with a Babel plugin
This commit converts the pdfjsdev-loader transform into a Babel plugin,
to skip a AST->string->AST round-trip.

Before this commit, the webpack build process was:
1. Babel parses the code
2. Babel transforms the AST
3. Babel generates the code
4. Acorn parses the code
5. pdfjsdev-loader transforms the AST
6. @javascript-obfuscator/escodegen generates the code
7. Webpack parses the file
8. Webpack concatenates the files

After this commit, it is reduced to:
1. Babel parses the code
2. Babel transforms the AST
3. babel-plugin-pdfjs-preprocessor transforms the AST
4. Babel generates the code
5. Webpack parses the file
6. Webpack concatenates the files

This change improves the build time by ~25% (tested on MacBook Air M2):
- `gulp lib`: 3.4s to 2.6s
- `gulp dist`: 36s to 29s
- `gulp generic`: 5.5s to 4.0s
- `gulp mozcentral`: 4.7s to 3.2s

The new Babel plugin doesn't support the `saveComments` option of
pdfjsdev-loader, and it just always discards comments. Even though
pdfjsdev-loader supported multiple values for that option, it was
effectively ignored due to `acorn` dropping comments by default.
2024-01-23 16:00:59 +01:00

79 lines
2.2 KiB
JSON

{
"name": "pdf.js",
"type": "module",
"devDependencies": {
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.8",
"@babel/runtime": "^7.23.8",
"@fluent/bundle": "^0.18.0",
"@fluent/dom": "^0.9.0",
"@jazzer.js/core": "^2.1.0",
"autoprefixer": "^10.4.17",
"babel-loader": "^9.1.3",
"caniuse-lite": "^1.0.30001579",
"canvas": "^2.11.2",
"core-js": "^3.35.0",
"cross-env": "^7.0.3",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-fetch-options": "^0.0.5",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jasmine": "^4.1.3",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-mozilla": "^3.3.2",
"eslint-plugin-no-unsanitized": "^4.0.2",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-sort-exports": "^0.8.0",
"eslint-plugin-unicorn": "^50.0.1",
"globals": "^13.24.0",
"gulp": "^4.0.2",
"gulp-cli": "^2.3.0",
"gulp-postcss": "^9.1.0",
"gulp-rename": "^2.0.0",
"gulp-replace": "^1.1.4",
"gulp-zip": "^6.0.0",
"jasmine": "^5.1.0",
"jsdoc": "^4.0.2",
"jstransformer-markdown-it": "^3.0.0",
"merge-stream": "^2.0.0",
"mkdirp": "^3.0.1",
"needle": "^3.3.1",
"path2d-polyfill": "^2.0.1",
"pngjs": "^7.0.0",
"postcss": "^8.4.33",
"postcss-dark-theme-class": "^1.1.0",
"postcss-dir-pseudo-class": "^8.0.1",
"postcss-discard-comments": "^6.0.1",
"postcss-nesting": "^12.0.2",
"prettier": "^3.2.4",
"puppeteer": "^21.7.0",
"rimraf": "^3.0.2",
"streamqueue": "^1.1.2",
"stylelint": "^16.2.0",
"stylelint-prettier": "^5.0.0",
"terser": "^5.27.0",
"through2": "^4.0.2",
"tsc-alias": "^1.8.8",
"ttest": "^4.0.0",
"typescript": "^5.3.3",
"typogr": "^0.6.8",
"vinyl": "^3.0.0",
"webpack": "^5.89.0",
"webpack-stream": "^7.0.0",
"wintersmith": "^2.5.0",
"yargs": "^17.7.2"
},
"scripts": {
"postinstall": "cross-env PUPPETEER_PRODUCT=firefox node node_modules/puppeteer/install.mjs"
},
"repository": {
"type": "git",
"url": "git://github.com/mozilla/pdf.js.git"
},
"engines": {
"node": ">=18"
},
"license": "Apache-2.0"
}