Browse Source

Fix module is not defined issue

pull/267/head
Jerome Wu 6 years ago
parent
commit
cdb86c694a
  1. 6
      dist/tesseract.js
  2. 2
      dist/tesseract.min.js
  3. 2
      dist/tesseract.min.js.map
  4. 2
      dist/worker.js
  5. 2
      dist/worker.min.js
  6. 2
      dist/worker.min.js.map
  7. 13
      package-lock.json
  8. 2
      package.json
  9. 2
      src/browser/index.js
  10. 2
      src/browser/worker.js

6
dist/tesseract.js vendored

@ -187,11 +187,11 @@ process.umask = function() { return 0; }; @@ -187,11 +187,11 @@ process.umask = function() { return 0; };
},{}],2:[function(require,module,exports){
module.exports={
"name": "tesseract.js",
"version": "1.0.13",
"version": "1.0.14",
"description": "Pure Javascript Multilingual OCR",
"main": "src/index.js",
"scripts": {
"start": "concurrently --kill-others \"watchify src/index.js -t [ envify --NODE_ENV development ] -t [ babelify --presets [ es2015 ] ] -o dist/tesseract.dev.js --standalone Tesseract\" \"watchify src/browser/worker.js -t [ envify --NODE_ENV development ] -t [ babelify --presets [ es2015 ] ] -o dist/worker.dev.js\" \"http-server -p 7355\"",
"start": "concurrently --kill-others \"watchify src/index.js -t [ envify --TESS_ENV development ] -t [ babelify --presets [ es2015 ] ] -o dist/tesseract.dev.js --standalone Tesseract\" \"watchify src/browser/worker.js -t [ envify --TESS_ENV development ] -t [ babelify --presets [ es2015 ] ] -o dist/worker.dev.js\" \"http-server -p 7355\"",
"build": "browserify src/index.js -t [ babelify --presets [ es2015 ] ] -o dist/tesseract.js --standalone Tesseract && browserify src/browser/worker.js -t [ babelify --presets [ es2015 ] ] -o dist/worker.js && uglifyjs dist/tesseract.js --source-map -o dist/tesseract.min.js && uglifyjs dist/worker.js --source-map -o dist/worker.min.js",
"release": "npm run build && git commit -am 'new release' && git push && git tag `jq -r '.version' package.json` && git push origin --tags && npm publish"
},
@ -242,7 +242,7 @@ var defaultOptions = { @@ -242,7 +242,7 @@ var defaultOptions = {
langPath: 'https://tessdata.projectnaptha.com/3.02/'
};
if (process.env.NODE_ENV === "development") {
if (process.env.TESS_ENV === "development") {
console.debug('Using Development Configuration');
defaultOptions.workerPath = location.protocol + '//' + location.host + '/dist/worker.dev.js?nocache=' + Math.random().toString(36).slice(3);
} else {

2
dist/tesseract.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/tesseract.min.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/worker.js vendored

@ -8654,7 +8654,7 @@ function fetchLanguageData(req, res, cb) { @@ -8654,7 +8654,7 @@ function fetchLanguageData(req, res, cb) {
var workerUtils = require('../common/worker.js');
if (process.env.NODE_ENV === "development") {
if (process.env.TESS_ENV === "development") {
console.debug('Using Development Worker');
}

2
dist/worker.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/worker.min.js.map vendored

File diff suppressed because one or more lines are too long

13
package-lock.json generated

@ -1566,7 +1566,8 @@ @@ -1566,7 +1566,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -1981,7 +1982,8 @@ @@ -1981,7 +1982,8 @@
"safe-buffer": {
"version": "5.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -2037,6 +2039,7 @@ @@ -2037,6 +2039,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -2080,12 +2083,14 @@ @@ -2080,12 +2083,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},

2
package.json

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
"description": "Pure Javascript Multilingual OCR",
"main": "src/index.js",
"scripts": {
"start": "concurrently --kill-others \"watchify src/index.js -t [ envify --NODE_ENV development ] -t [ babelify --presets [ es2015 ] ] -o dist/tesseract.dev.js --standalone Tesseract\" \"watchify src/browser/worker.js -t [ envify --NODE_ENV development ] -t [ babelify --presets [ es2015 ] ] -o dist/worker.dev.js\" \"http-server -p 7355\"",
"start": "concurrently --kill-others \"watchify src/index.js -t [ envify --TESS_ENV development ] -t [ babelify --presets [ es2015 ] ] -o dist/tesseract.dev.js --standalone Tesseract\" \"watchify src/browser/worker.js -t [ envify --TESS_ENV development ] -t [ babelify --presets [ es2015 ] ] -o dist/worker.dev.js\" \"http-server -p 7355\"",
"build": "browserify src/index.js -t [ babelify --presets [ es2015 ] ] -o dist/tesseract.js --standalone Tesseract && browserify src/browser/worker.js -t [ babelify --presets [ es2015 ] ] -o dist/worker.js && uglifyjs dist/tesseract.js --source-map -o dist/tesseract.min.js && uglifyjs dist/worker.js --source-map -o dist/worker.min.js",
"release": "npm run build && git commit -am 'new release' && git push && git tag `jq -r '.version' package.json` && git push origin --tags && npm publish"
},

2
src/browser/index.js

@ -4,7 +4,7 @@ var defaultOptions = { @@ -4,7 +4,7 @@ var defaultOptions = {
langPath: 'https://tessdata.projectnaptha.com/3.02/',
}
if (process.env.NODE_ENV === "development") {
if (process.env.TESS_ENV === "development") {
console.debug('Using Development Configuration')
defaultOptions.workerPath = location.protocol + '//' + location.host + '/dist/worker.dev.js?nocache=' + Math.random().toString(36).slice(3)
}else{

2
src/browser/worker.js

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
const workerUtils = require('../common/worker.js')
if (process.env.NODE_ENV === "development") {
if (process.env.TESS_ENV === "development") {
console.debug('Using Development Worker')
}

Loading…
Cancel
Save