The docs mention wasm-pack init to initialize a project with wasm-pack. This creates the package files in pkg by performing quite a few steps and takes a while (2 mins on a smallish project for me).
My question is when I make changes to the Rust source how do I then _just_ rebuild what is in pkg? Do I invoke Rust compiler and wasm-bindgen manually, or does wasm-pack provide something like a build command that only does this?
Also do you think it's useful to mention this in docs? If so, I'm happy to make a PR for that.
Hmmm this is unclear I guess, but you use init as the command to build it as well! cc/ @ashleygwilliams maybe we need to consider different commands or verbiage? Or just better docs.
Sure you could use init again but if I do that, init it takes around 2 mins whereas if I just run the following it's almost immediately completes and does what I need:
cargo +nightly build --target wasm32-unknown-unknown
wasm-bindgen target/wasm32-unknown-unknown/debug/my_wasm.wasm \
--out-dir pkg
For now I've put that in a script and invoke it using a Makefile but I'm curious how other's workflow looks. Maybe this is outside the scope of wasm-pack?
So there's a problem outlined in #115 that we kept running into. There's a flag added in https://github.com/ashleygwilliams/wasm-pack/issues/144 that will make it easy to just skip that stuff that makes the build take forever that's being released (hopefully) today. We are trying to make the tool handle, if I need to upgrade bindgen how and how is it tied to this version for the program. It's just something we haven't necessarily gotten around too/found the best solution to yet. It's not outside the scope of wasm-pack! We're just trying to figure out some things and wasm-bindgen is kind of the main driver of those since it's development is in flux.
yeah i was actually gonna make a --no-install flag today that runs exactly what you shared @mtharrison - i sorta like wasm-pack build more but dont wanna make that call without discussion! would love to hear more about the set of commands you'd expect and what they should be named! we've been growing kinda fast and have def outgrown our original definitions-
Cool, that will do the job I think. In terms of expectation, I would probably expect either wasm-pack build or maybe just wasm-pack ..
@mtharrison a first pass at fixing this is landing in today's 0.4.0 release, you can invoke it as wasm-pack init <optional path> --mode no-install, but for the next release i think we'll figure out how to separate init into build and init
closed by #186 and convo for splitting the commands is now in #188
That's great news, thanks!
Most helpful comment
Cool, that will do the job I think. In terms of expectation, I would probably expect either
wasm-pack buildor maybe justwasm-pack ..