refactor: centralize CDN config and fix service worker fallback

- Centralize CDN versions/URLs in cdn-version.ts
- Switch LibreOffice to @bentopdf/libreoffice-wasm package
- Fix service worker fallback to support all WASM packages
- Remove dead code and silence production logs
This commit is contained in:
abdullahalam123
2025-12-30 22:58:25 +05:30
parent 659a4b1a32
commit 2f8086ad59
30 changed files with 560 additions and 338 deletions

View File

@@ -0,0 +1,11 @@
export const PACKAGE_VERSIONS = {
libreoffice: '2.3.1',
ghostscript: '0.1.0',
pymupdf: '0.1.9',
} as const;
export const CDN_URLS = {
libreoffice: `https://cdn.jsdelivr.net/npm/@bentopdf/libreoffice-wasm@${PACKAGE_VERSIONS.libreoffice}/assets/`,
ghostscript: `https://cdn.jsdelivr.net/npm/@bentopdf/gs-wasm@${PACKAGE_VERSIONS.ghostscript}/assets/`,
pymupdf: `https://cdn.jsdelivr.net/npm/@bentopdf/pymupdf-wasm@${PACKAGE_VERSIONS.pymupdf}/assets/`,
} as const;