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
Provide a nicer way to load the WASM #23
Comments
I created a I tested it with @sindresorhus does it solve the boilerplate problem for you? |
Yes, that looks good. Thanks for doing that. I would personally have made |
It should work fine in any bundler that support export conditions, which I think Webpack 5 supports. |
When creating this lib, it was mainly used in CF Workers which has a special way to load WASM (https://blog.cloudflare.com/webassembly-on-cloudflare-workers) as well as Vercel's Edge Runtime (https://vercel.com/docs/concepts/functions/edge-functions/wasm#using-a-webassembly-file). And then there's the use case of using inside the browser and I wanted to prefetch the WASM file via a tag. Because there're probably more runtimes out there I made it that way to make sure it's flexible enough. |
I don't see why it requires the boilerplate. This package could simply do the following internally: https://github.com/vadimdemedes/ink/pull/550/files#diff-71628bd9ca8b59e4cfa0d8ae58caf4e8d5072d71a34be7517b7876b27c415dff
I should be able to do this and be done:
For custom loading of WASM, there could be an alternative sub-export or something, but the main export should be the nicest one.
The text was updated successfully, but these errors were encountered: