Ohh, also just found about about "[package.metadata]" in Cargo.toml. Could easily do "[package.metadata.npm]" for npm specific things - and otherwise assume Rust libs should be published as "libname-wasm" on npm. Should make it reallll easy to publish hey.
-
-
Show this thread
-
The "main" target for the package.json could just directly be the WASM binary. Can easily inline it for the browser - but also serve up for streaming. Assuming `.wasm` can't be required yet in Node, doing `var libname = new Buffer(require.resolve('libname-wasm'))` should cut it.
Show this thread
End of conversation
New conversation -
-
-
assuming publishing to crates.io, then to npm: npm already has prepublish – running a bunch of cargo commands there should be same as running a bunch of npm commands in a cargo postpublish, right?
-
True! - but if it's an actively developed Rust project, it would probably feel odd to use npm commands to do all the Rust things haha. I'm thinking like a _full_ auto deploy for Rust - just multiple output targets, and perhaps an epiphemeral package.json file :D
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.