about summary refs log tree commit diff
path: root/babel.config.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-08-15 17:24:45 +0200
committerGitHub <noreply@github.com>2019-08-15 17:24:45 +0200
commitdfe60598899738250fc707db91048b871ab09282 (patch)
treefede8594828377880d7c0908ee6f12e63cdc1ca9 /babel.config.js
parent28636f43e4b0c04befa243b847c38e81c90f1289 (diff)
Fix tesseract.js being part of the common chunk (#11571)
* Fix tesseract.js being part of the common chunk

Besides being 620 KB large, it also causes a modules-related runtime
error in production...

* Fix code style issue

* Fix modules error
Diffstat (limited to 'babel.config.js')
-rw-r--r--babel.config.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/babel.config.js b/babel.config.js
index a506ad8ce..3f7ff84db 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -20,6 +20,12 @@ module.exports = (api) => {
       ['react-intl', { messagesDir: './build/messages' }],
       'preval',
     ],
+    overrides: [{
+      test: /tesseract\.js/,
+      presets: [
+        ['@babel/env', { ...envOptions, modules: 'commonjs' }],
+      ],
+    }],
   };
 
   switch (env) {