refactor(pdf): use minified and remove unnecessary vite config
This commit is contained in:
parent
88d988e60b
commit
738a6b87f5
@ -37,7 +37,7 @@ import { truncate } from 'lodash'
|
|||||||
import { hexToNpub } from '../../utils'
|
import { hexToNpub } from '../../utils'
|
||||||
import { toPdfFiles } from '../../utils/pdf.ts'
|
import { toPdfFiles } from '../../utils/pdf.ts'
|
||||||
PDFJS.GlobalWorkerOptions.workerSrc = new URL(
|
PDFJS.GlobalWorkerOptions.workerSrc = new URL(
|
||||||
'pdfjs-dist/build/pdf.worker.mjs',
|
'pdfjs-dist/build/pdf.worker.min.mjs',
|
||||||
import.meta.url
|
import.meta.url
|
||||||
).toString()
|
).toString()
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { PDFDocument } from 'pdf-lib'
|
|||||||
import { Mark } from '../types/mark.ts'
|
import { Mark } from '../types/mark.ts'
|
||||||
|
|
||||||
PDFJS.GlobalWorkerOptions.workerSrc = new URL(
|
PDFJS.GlobalWorkerOptions.workerSrc = new URL(
|
||||||
'pdfjs-dist/build/pdf.worker.mjs',
|
'pdfjs-dist/build/pdf.worker.min.mjs',
|
||||||
import.meta.url
|
import.meta.url
|
||||||
).toString()
|
).toString()
|
||||||
|
|
||||||
|
@ -5,15 +5,6 @@ import tsconfigPaths from 'vite-tsconfig-paths'
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), tsconfigPaths()],
|
plugins: [react(), tsconfigPaths()],
|
||||||
build: {
|
build: {
|
||||||
target: 'ES2022',
|
target: 'ES2022'
|
||||||
rollupOptions: {
|
|
||||||
output: {
|
|
||||||
manualChunks(id) {
|
|
||||||
if (id.includes('pdfjs-dist/build/pdf.worker.mjs')) {
|
|
||||||
return 'pdf.worker'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user