mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-24 22:19:04 +00:00
feat(webui): self-host pdf.worker.min.mjs in public directory
This commit is contained in:
@@ -76,6 +76,7 @@ export default tseslint.config(
|
||||
'**/data/**',
|
||||
'**/packages/webui/components/ui/**',
|
||||
'**/packages/webui/paraglide/**',
|
||||
'**/packages/webui/public/**',
|
||||
],
|
||||
},
|
||||
js.configs.recommended,
|
||||
|
||||
@@ -7,7 +7,7 @@ import { FileViewerProps, MediaController } from '../types'
|
||||
import { PdfControlBar } from './pdf-control-bar'
|
||||
|
||||
if (typeof window !== 'undefined' && pdfjsLib.GlobalWorkerOptions) {
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${pdfjsLib.version}/build/pdf.worker.min.mjs`
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = '/pdf.worker.min.mjs'
|
||||
}
|
||||
|
||||
export const PdfViewer = React.forwardRef<MediaController, FileViewerProps>(
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user