pdf.js/external
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
..
bcmaps Removes external/cmaps; adds binary cmaps to the repo 2014-03-17 13:30:27 -05:00
builder Replace the webpack+acorn transform with a Babel plugin 2024-01-23 16:00:59 +01:00
cmapscompress [ESM] Convert the "cmaps"-task to use import() syntax 2023-07-08 18:52:58 +02:00
dist Rename *.d.ts to *.d.mts. Close #17241 2023-11-12 07:30:36 +09:00
importL10n Update the path to get all locales and update locales 2023-10-25 12:47:06 +02:00
quickjs Update quickjs to revision 2788d71e823b522b178db3b3660ce93689534e6d 2022-05-01 15:53:50 +02:00
standard_fonts [api-minor] Use a local font or fallback on an embedded one (if it exists) for non-embedded fonts (bug 1766039) 2023-05-10 14:10:23 +02:00
.eslintrc Enable unicorn/prefer-at unconditionally (PR 15014 follow-up) 2023-05-07 13:43:19 +02:00
.gitignore Removes external/cmaps; adds binary cmaps to the repo 2014-03-17 13:30:27 -05:00