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

Option for getting a manifest entry synchronously? #7

Open
bgl3317 opened this issue Sep 29, 2020 · 1 comment
Open

Option for getting a manifest entry synchronously? #7

bgl3317 opened this issue Sep 29, 2020 · 1 comment

Comments

@bgl3317
Copy link

bgl3317 commented Sep 29, 2020

I'd like to use this module inside of a webpack config file where I have to synchronously resolve all of the values inside of module.exports. Is there any way or workaround for getting the manifest entries synchronously?

@limulus
Copy link
Owner

limulus commented Sep 29, 2020

Not out of the box, unfortunately. The underlying module that reads the JAR file only has an async API, so would need to move off ls-archive for that functionality. (Good chance there is something better to use these days anyway.)

One workaround would be to put the code that calls jarfile in its own JS file, and call it from your webpack config using spawnSync(). But if you are going to be calling out to another binary and parsing its output there may be other tools to use.

That said, maybe WebPack supports async configuration already? webpack/webpack#2697

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants