Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative CDN or self hosting #727

Closed
CodingPeak opened this issue Apr 5, 2023 · 4 comments
Closed

Alternative CDN or self hosting #727

CodingPeak opened this issue Apr 5, 2023 · 4 comments

Comments

@CodingPeak
Copy link

Yesterday unpkg CDN was down. Can you provide a version that doesn't rely on unpkg's availability? Is it possible to host the javascript files ourselves?

@Peyman-Borhani
Copy link

@CodingPeak I tried multiple ways of importing, it all works, so I download the latest ".min.js" file mentioned in Installation - CDN, and directly use it in my code.

@Balearica
Copy link
Member

The use of unpkg is just a result of using the default arguments. You can host everything yourself--this is explained here.

In short, the 3 relevant arguments are workerPath, langPath, and corePath. By default these are set to fetch code/data from unpkg, however you can change them to anything else (including a location on your site you are hosting them).

@CodingPeak
Copy link
Author

CodingPeak commented Apr 8, 2023

I believe this requires having a nodejs environment, which I don't want to set up. Is there no way to just download the required files? A built version of the files? Most projects have a dist folder, but can't find that here. I don't want to be dependent on the availability of a CDN.

@Balearica
Copy link
Member

You can just download the files once from the CDN (the paths are specified in the article I linked) and host them yourself. For example the current version of worker.min.js is here: https://unpkg.com/tesseract.js@v4.0.3/dist/worker.min.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants