upgrade to pdfjs-dist 4.*

This commit is contained in:
Raphael 2024-05-07 22:04:23 +02:00
parent 41f62d2303
commit e0d03da850
4 changed files with 13 additions and 14 deletions

View File

@ -10,8 +10,7 @@ const __dirname = path.dirname(__filename);
const config = { const config = {
entry: { entry: {
main: ["./src/js/index.js"], main: ["./src/js/index.js"]
"pdf.worker": "pdfjs-dist/build/pdf.worker.entry",
}, },
output: { output: {
path: path.join(__dirname, "..", "dist"), path: path.join(__dirname, "..", "dist"),

20
package-lock.json generated
View File

@ -47,7 +47,7 @@
"jquery": "^3.6.0", "jquery": "^3.6.0",
"jquery-ui": "^1.13.2", "jquery-ui": "^1.13.2",
"keymage": "^1.1.3", "keymage": "^1.1.3",
"pdfjs-dist": "^3.11.174", "pdfjs-dist": "^4.2.67",
"prettier": "^2.5.1", "prettier": "^2.5.1",
"pretty-quick": "^2.0.1", "pretty-quick": "^2.0.1",
"style-loader": "^1.1.4", "style-loader": "^1.1.4",
@ -10697,27 +10697,27 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/path2d-polyfill": { "node_modules/path2d": {
"version": "2.0.1", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz", "resolved": "https://registry.npmjs.org/path2d/-/path2d-0.2.0.tgz",
"integrity": "sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA==", "integrity": "sha512-KdPAykQX6kmLSOO6Jpu2KNcCED7CKjmaBNGGNuctOsG0hgYO1OdYQaan6cYXJiG0WmXOwZZPILPBimu5QAIw3A==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"engines": { "engines": {
"node": ">=8" "node": ">=6"
} }
}, },
"node_modules/pdfjs-dist": { "node_modules/pdfjs-dist": {
"version": "3.11.174", "version": "4.2.67",
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.11.174.tgz", "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-4.2.67.tgz",
"integrity": "sha512-TdTZPf1trZ8/UFu5Cx/GXB7GZM30LT+wWUNfsi6Bq8ePLnb+woNKtDymI2mxZYBpMbonNFqKmiz684DIfnd8dA==", "integrity": "sha512-rJmuBDFpD7cqC8WIkQUEClyB4UAH05K4AsyewToMTp2gSy3Rrx8c1ydAVqlJlGv3yZSOrhEERQU/4ScQQFlLHA==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"optionalDependencies": { "optionalDependencies": {
"canvas": "^2.11.2", "canvas": "^2.11.2",
"path2d-polyfill": "^2.0.1" "path2d": "^0.2.0"
} }
}, },
"node_modules/picocolors": { "node_modules/picocolors": {

View File

@ -68,7 +68,7 @@
"jquery": "^3.6.0", "jquery": "^3.6.0",
"jquery-ui": "^1.13.2", "jquery-ui": "^1.13.2",
"keymage": "^1.1.3", "keymage": "^1.1.3",
"pdfjs-dist": "^3.11.174", "pdfjs-dist": "^4.2.67",
"prettier": "^2.5.1", "prettier": "^2.5.1",
"pretty-quick": "^2.0.1", "pretty-quick": "^2.0.1",
"style-loader": "^1.1.4", "style-loader": "^1.1.4",

View File

@ -11,7 +11,7 @@ import { getSubDir } from "./utils.js";
import ConfigService from "./services/ConfigService.js"; import ConfigService from "./services/ConfigService.js";
import { v4 as uuidv4 } from "uuid"; import { v4 as uuidv4 } from "uuid";
import pdfjsLib from "pdfjs-dist"; import * as pdfjsLib from 'pdfjs-dist/webpack.mjs';
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
let whiteboardId = urlParams.get("whiteboardid"); let whiteboardId = urlParams.get("whiteboardid");