fix(desktop): tesseract.js not copied

This commit is contained in:
Elian Doran
2026-04-05 22:22:58 +03:00
parent 1e861d1125
commit dc1e0e8db4
2 changed files with 8 additions and 7 deletions

View File

@@ -12,13 +12,6 @@ async function main() {
// Copy node modules dependencies
build.copyNodeModules([ "better-sqlite3", "bindings", "file-uri-to-path" ]);
// Tesseract.js worker runs in a separate worker_thread and needs its
// source files (+ WASM core + transitive deps) on disk — they cannot be bundled.
build.copyNodeModules([
"tesseract.js", "tesseract.js-core", "wasm-feature-detect",
"regenerator-runtime", "is-url", "bmp-js"
]);
build.copy("/node_modules/ckeditor5/dist/ckeditor5-content.css", "ckeditor5-content.css");
build.buildFrontend();

View File

@@ -68,6 +68,14 @@ export default class BuildHelper {
minify: true
});
writeFileSync(join(this.outDir, "meta.json"), JSON.stringify(result.metafile));
// Tesseract.js is marked as external above because its worker runs in
// a separate worker_thread. Copy the worker source, WASM core and all
// transitive runtime deps so they are available in dist/node_modules.
this.copyNodeModules([
"tesseract.js", "tesseract.js-core", "wasm-feature-detect",
"regenerator-runtime", "is-url", "bmp-js"
]);
}
buildFrontend() {