tesseract.js-angular-app
tesseract.js-angular-app copied to clipboard
Not building in production mode
Hi,
I had a problem building to production (ng build --prod) with our Angular 8 project using latest version of Tesseract. I downloaded this repo and tried to build to production and got same error here. It works fine as long as you don't build for prod.
I ran a build with more logging. Command: ng build --prod --named-chunks --verbose --build-optimizer=false --source-map
Error message: ERROR in main-es5.3b4ae72f66dfaabd87b7.js from Terser Unexpected token: punc ()) [./node_modules/tesseract.js/src/common/TesseractWorker.js:165,0][main-es5.3b4ae72f66dfaabd87b7.js:200,6]
The problem seems to trailing comma in function params on row 164 in tesseract.js/src/common/TesseractWorker.js. When I remove it and build the error is gone.
Any ideas what config is missing to get this project to build for production with support for es5? I cannot figure out how to solve this in Angular.
Cheers!