diff --git a/Makefile b/Makefile index 3e2a81e..9a0242d 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ checkformat: node_modules/.bin/prettier --check {src,test}/**/*.js .PHONY: typecheck -typecheck: +typecheck: build/tesseract-core.d.ts node_modules/.bin/tsc .PHONY: test @@ -164,7 +164,6 @@ build/tesseract-core.js build/tesseract-core.wasm: src/lib.cpp src/tesseract-ini $(EMSDK_DIR)/emcc src/lib.cpp $(EMCC_FLAGS) \ -I$(INSTALL_DIR)/include/ -L$(INSTALL_DIR)/lib/ -ltesseract -lleptonica -lembind \ -o build/tesseract-core.js - cp src/tesseract-core.d.ts build/ # Build fallback WASM binary for browsers that don't support WASM SIMD. The JS # output from this build is not used. @@ -173,6 +172,9 @@ build/tesseract-core-fallback.js build/tesseract-core-fallback.wasm: src/lib.cpp -I$(INSTALL_DIR)/include/ -L$(FALLBACK_INSTALL_DIR)/lib/ -L$(INSTALL_DIR)/lib -ltesseract -lleptonica -lembind \ -o build/tesseract-core-fallback.js +build/tesseract-core.d.ts: src/tesseract-core.d.ts build + cp $< $@ + dist/tesseract-core.wasm: build/tesseract-core.wasm mkdir -p dist/ cp $< $@ diff --git a/src/ocr-engine.ts b/src/ocr-engine.ts index cbc7dda..82e136a 100644 --- a/src/ocr-engine.ts +++ b/src/ocr-engine.ts @@ -1,4 +1,3 @@ -// @ts-ignore - Don't error if library hasn't been built yet. import initTesseractCore from "../build/tesseract-core"; import { imageDataFromBitmap } from "./utils";