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

Multiple entries #16

Merged
merged 11 commits into from
May 7, 2019
Merged

Multiple entries #16

merged 11 commits into from
May 7, 2019

Conversation

mysterycommand
Copy link
Owner

Fix #9

Supports multiple entries by creating emitting a module that requires the wasm-pack generated initializer (with imports object) and path to the bundled wasm and returns the __exports object. With that the packager writes it's own loader that rewrites the bundle cache so that when the entry is required it looks up the bindgen.

Current limitations:

  1. only one (1) crate per entry/bundle (might be fixable with a Promise.all and some kind of dynamic renaming trick)
  2. only verified to work in browser (but shouldn't be too hard to rewire for nodejs)
  3. kinda hacky extending a private class JSPackager no support if someone's using the JSConcatPackager … might just try and get some help to reimplement this the Right Way™ for Parcel 2

@mysterycommand mysterycommand merged commit a47e8af into master May 7, 2019
@mysterycommand mysterycommand deleted the fix/9/multiple-entries branch May 7, 2019 19:29
@mysterycommand
Copy link
Owner Author

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Plugin doesn't work with multiple crates/entries
1 participant