Browse Source

Replace jsdeliver with unpack and remove dist

develop
Jerome Wu 6 years ago
parent
commit
53be7e5726
  1. 1
      .gitignore
  2. 2
      README.md
  3. 4
      docs/local-installation.md
  4. 4
      src/browser/index.js

1
.gitignore vendored

@ -6,3 +6,4 @@ worker.dev.js
/*.traineddata /*.traineddata
/examples/**/*.traineddata /examples/**/*.traineddata
.nyc_output .nyc_output
dist

2
README.md

@ -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: You can simply include Tesseract.js with a CDN like this:
```html ```html
<script src='https://cdn.jsdelivr.net/gh/naptha/tesseract.js@v2.0.0-alpha.2/dist/tesseract.min.js'></script> <script src='https://unpkg.com/tesseract.js@v2.0.0-alpha.3/dist/tesseract.min.js'></script>
``` ```
After including your scripts, the `Tesseract` variable will be defined globally! After including your scripts, the `Tesseract` variable will be defined globally!

4
docs/local-installation.md

@ -8,9 +8,9 @@ In Node.js environment, the only path you may want to customize is languages/lan
```javascript ```javascript
const worker = Tesseract.TesseractWorker({ const worker = Tesseract.TesseractWorker({
workerPath: 'https://cdn.jsdelivr.net/gh/naptha/tesseract.js@v2.0.0-alpha.2/dist/worker.min.js', workerPath: 'https://unpkg.com/tesseract.js@v2.0.0-alpha.3/dist/worker.min.js',
langPath: 'https://tessdata.projectnaptha.com/4.0.0', langPath: 'https://tessdata.projectnaptha.com/4.0.0',
corePath: 'https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@v2.0.0-beta.5/tesseract-core.js', corePath: 'https://unpkg.com/tesseract.js-core@v2.0.0-beta.5/tesseract-core.js',
}); });
``` ```

4
src/browser/index.js

@ -78,12 +78,12 @@ exports.defaultOptions = {
...defaultOptions, ...defaultOptions,
workerPath: process.env.TESS_ENV === 'development' workerPath: process.env.TESS_ENV === 'development'
? resolveURL(`/dist/worker.dev.js?nocache=${Math.random().toString(36).slice(3)}`) ? 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, * If browser doesn't support WebAssembly,
* load ASM version instead * load ASM version instead
*/ */
corePath: `https://cdn.jsdelivr.net/gh/naptha/tesseract.js-core@v2.0.0-beta.5/tesseract-core${typeof WebAssembly === 'object' ? '' : '.asm'}.js`, corePath: `https://unpkg.com/tesseract.js-core@v2.0.0-beta.5/tesseract-core${typeof WebAssembly === 'object' ? '' : '.asm'}.js`,
}; };
/** /**

Loading…
Cancel
Save