How do you rebuild a rust wasm application after changes?

457 Views Asked by At

I'm using wasm pack to build a web app from rust. I went through docs for getting started and was able to build the application with npm init wasm-app dirname and run it in the browser. However, when I change and build the rust code the changes aren't reflected in the app being served. Is there a standard way to re-build (maybe even automate re-building) the rust app and the app built by npm init wasm-app command?

1

There are 1 best solutions below

0
On

I ended up missing a step. I needed to add

{
   app_name: "file:../pkg",
   ...  
}

to the dependencies in package.json

now wasm-pack build updates the app as expected