mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 10:55:27 +00:00
feat(web): register pdf.worker route manually in prod mode
This commit is contained in:
@@ -6,9 +6,7 @@ import React, { useCallback, useEffect, useImperativeHandle, useRef, useState }
|
||||
import { FileViewerProps, MediaController } from '../types'
|
||||
import { PdfControlBar } from './pdf-control-bar'
|
||||
|
||||
const { default: pdfworker } = await import('@/ui/public/pdf.worker.min.mjs', {
|
||||
with: { type: 'file' },
|
||||
})
|
||||
import pdfworker from '@/ui/public/pdf.worker.min.mjs' with { type: 'file' }
|
||||
|
||||
if (typeof window !== 'undefined' && pdfjsLib.GlobalWorkerOptions) {
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = pdfworker
|
||||
|
||||
Reference in New Issue
Block a user