File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { Button } from '@/components/ui/button';
55import { Input } from '@/components/ui/input' ;
66import { ScrollArea } from '@/components/ui/scroll-area' ;
77
8+ // Configure PDF.js worker
89pdfjs . GlobalWorkerOptions . workerSrc = `//unpkg.com/pdfjs-dist@${ pdfjs . version } /build/pdf.worker.min.mjs` ;
910
1011interface PdfViewerProps {
Original file line number Diff line number Diff line change @@ -19,5 +19,19 @@ export default defineConfig({
1919 optimizeDeps : {
2020 exclude : [ 'lucide-react' ] ,
2121 include : [ 'react-pdf' , 'pdfjs-dist' ] ,
22+ esbuildOptions : {
23+ // Ensure Node.js globals are available
24+ define : {
25+ global : 'globalThis' ,
26+ } ,
27+ } ,
28+ } ,
29+ worker : {
30+ format : 'es' ,
31+ plugins : ( ) => [
32+ nodePolyfills ( {
33+ protocolImports : true ,
34+ } ) ,
35+ ] ,
2236 } ,
2337} ) ;
You can’t perform that action at this time.
0 commit comments