rustwasm / wasm-pack

📦✨ your favorite rust -> wasm workflow tool!
https://rustwasm.github.io/wasm-pack/
Apache License 2.0
6.22k stars 404 forks source link

jsdelivr support #445

Open DevinBayly opened 5 years ago

DevinBayly commented 5 years ago

Wasm npm imports on client side after page load?

I can't tell if this issue is supposed to be a feature request for something missing, or a call for attention to something provided that I can't track down the details of. I'm creating a tool that is meant to be used for browser based datascience. At the moment there is existing support for importing libraries like those hosted on cdnjs and certain npm libraries that work with jsdelivr. I'm curious if wasm-pack (probably the build step) can be configured in such a way that the output will lend itself to these inclusion by script source url methods. Thanks for all the work so far, and if this is just not possible for reasons that I'm unaware of we can close this issue out.

ashleygwilliams commented 5 years ago

hey! i'm not 100% sure what that would require but i'm very happy to do the research! thanks for filing :) i'll follow up when i know more

DevinBayly commented 5 years ago

I forgot to post an update here. The path that worked very nicely was using --target no-modules in the wasm-pack build step, and from there the published package is then available from jsdelivr. I believe its more or less closed, but I'm planning on explaining in more detail how this is done in the demo Iodide notebook I wanted to discuss with you.

ashleygwilliams commented 5 years ago

hey @DevinBayly - apologies for the Extreme Delay in response. i'm still interested in exploring this. can you share if there's any further work we can do to enable this? potentially some documentation work? please let me know!

DevinBayly commented 5 years ago

not to worry! I took a break from the wasm-ndarray stuff so I haven't thought about this much recently. I am still writing wasm tools, but I'll need a moment to recall what I wanted to do here. Thanks for getting back to me though!