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

Build es6 module that can be used with an import statement #468

Closed
wants to merge 4 commits into from

Conversation

m0ose
Copy link

@m0ose m0ose commented Jul 16, 2020

I am working on a sketch that requires a version of tesseract that works with an import statement. In order to avoid a build step it would be nice to have a normal es6 module.
This way it can be imported from the browser like so ...

import Tesseract from '../node_modules/tesseract.js/dist/tesseract.es6.min.js'

I put an extra build option in the package.json file which uses rollup to make an es6 module.

@jeromewu
Copy link
Member

Sorry for pending this PR for so long.
But for me it would be much better to use webpack to build the es6 version instead of using rollup.

@Balearica
Copy link
Collaborator

Balearica commented Sep 5, 2022

While it would be ideal to continue using a single build system, it looks like Webpack does not currently support this. (There is an experimental feature, however I wasn't able to get it working, and looking at the relevant Git Issue many others are having problems as well.)
webpack/webpack#2933

Therefore, as I think there is significant benefit to offering an ESM module in the current year, I will merge this version in after confirming it still works and adding the necessary tests.

@Balearica
Copy link
Collaborator

Merged a modified version of this code in using a different PR (#659). Thank you for contributing.

@Balearica Balearica closed this Sep 5, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants