Skip to content

Commit 2d5100a

Browse files
committed
fix: restore pdfjs worker to .mjs and add mjs to webpack resolve extensions
pdfjs-dist v4 only ships .mjs worker files (no .js variants). the previous commit incorrectly changed the worker path to .mjs -> .js. reverted to pdf.worker.min.mjs and added .mjs to webpack resolve extensions in both dev and prod configs so webpack can locate the file. WCN-19
1 parent 1723780 commit 2d5100a

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

modules/web-demo/src/components/KeyCard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212

1313
// Configure pdfjs worker for webpack (must be set before calling extractKeycardEntriesFromPDF)
1414
GlobalWorkerOptions.workerSrc = new URL(
15-
'pdfjs-dist/build/pdf.worker.min.js',
15+
'pdfjs-dist/build/pdf.worker.min.mjs',
1616
import.meta.url,
1717
).toString();
1818

modules/web-demo/webpack/dev.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = (env, options) => {
2727
rules: devRules,
2828
},
2929
resolve: {
30-
extensions: ['.tsx', '.ts', '.js'],
30+
extensions: ['.tsx', '.ts', '.js', '.mjs'],
3131
alias: aliasItems,
3232
fallback: resolveFallback,
3333
},

modules/web-demo/webpack/prod.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = (env, options) => {
2323
rules: prodRules,
2424
},
2525
resolve: {
26-
extensions: ['.tsx', '.ts', '.js'],
26+
extensions: ['.tsx', '.ts', '.js', '.mjs'],
2727
alias: aliasItems,
2828
fallback: resolveFallback,
2929
},

0 commit comments

Comments
 (0)