perf: reduce tesseract bundle size by directly importing createWorker (#1979)

This commit is contained in:
Nolan Lawson 2021-03-06 09:07:06 -08:00 committed by GitHub
parent a2dcbcdcda
commit f22b1bf328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,7 @@
// We should explore this at a later date.
import corePath from 'tesseract.js-core/tesseract-core.wasm.js'
import workerPath from 'tesseract.js/dist/worker.min.js'
import { createWorker } from 'tesseract.js'
import createWorker from 'tesseract.js/src/createWorker.js'
const { origin } = location

View File

@ -15,7 +15,8 @@ const NOOP_MODULES = [
'tesseract.js/dist/worker.min.js.map',
'tesseract.js-core/tesseract-core.wasm',
'tesseract.js-core/tesseract-core.wasm.js',
'tesseract.js'
'tesseract.js/src/createWorker.js',
'tesseract.js/src/createWorker.js.map'
]
const serverResolve = JSON.parse(JSON.stringify(resolve))