Skip to content

Commit

Permalink
Replace jsdeliver with unpack and remove dist
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromewu committed May 10, 2019
1 parent dbd1e6b commit 53be7e5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ worker.dev.js
/*.traineddata
/examples/**/*.traineddata
.nyc_output
dist
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Tesseract.js works with a `<script>` tag via local copy or CDN, with webpack via

You can simply include Tesseract.js with a CDN like this:
```html
<script src='https://cdn.jsdelivr.net/gh/naptha/[email protected].2/dist/tesseract.min.js'></script>
<script src='https://unpkg.com/[email protected].3/dist/tesseract.min.js'></script>
```

After including your scripts, the `Tesseract` variable will be defined globally!
Expand Down
4 changes: 2 additions & 2 deletions docs/local-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ In Node.js environment, the only path you may want to customize is languages/lan

```javascript
const worker = Tesseract.TesseractWorker({
workerPath: 'https://cdn.jsdelivr.net/gh/naptha/[email protected].2/dist/worker.min.js',
workerPath: 'https://unpkg.com/[email protected].3/dist/worker.min.js',
langPath: 'https://tessdata.projectnaptha.com/4.0.0',
corePath: 'https://cdn.jsdelivr.net/gh/naptha/[email protected]/tesseract-core.js',
corePath: 'https://unpkg.com/[email protected]/tesseract-core.js',
});
```

Expand Down
4 changes: 2 additions & 2 deletions src/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ exports.defaultOptions = {
...defaultOptions,
workerPath: process.env.TESS_ENV === 'development'
? resolveURL(`/dist/worker.dev.js?nocache=${Math.random().toString(36).slice(3)}`)
: `https://cdn.jsdelivr.net/gh/naptha/tesseract.js@v${version}/dist/worker.min.js`,
: `https://unpkg.com/tesseract.js@v${version}/dist/worker.min.js`,
/*
* If browser doesn't support WebAssembly,
* load ASM version instead
*/
corePath: `https://cdn.jsdelivr.net/gh/naptha/[email protected]/tesseract-core${typeof WebAssembly === 'object' ? '' : '.asm'}.js`,
corePath: `https://unpkg.com/[email protected]/tesseract-core${typeof WebAssembly === 'object' ? '' : '.asm'}.js`,
};

/**
Expand Down

0 comments on commit 53be7e5

Please sign in to comment.