react-pdf
react-pdf copied to clipboard
Is there a way to async load PDF.js similar to pdf.worker.js? PDF.js is about 200kb, which is too large for me.
Before you start - checklist
- [X] I understand that React-PDF does not aim to be a fully-fledged PDF viewer and is only a tool to make one
- [X] I have checked if this feature request is not already reported
Description
// pdj.ts in react-pdj
import * as pdfjsModule from 'pdfjs-dist';
const pdfjs = ( 'default' in pdfjsModule ? pdfjsModule['default'] : pdfjsModule ) as typeof pdfjsModule;
export default pdfjs;
Proposed solution
external script load pdf.js
Alternatives
No response
Additional information
No response