panoptix-za / web-bundler

Bundles a Rust WebAssembly frontend application for publishing
Apache License 2.0
11 stars 3 forks source link

Print the frontend's files and dependencies for cargo to know when to rebuild #2

Open JWorthe opened 3 years ago

JWorthe commented 3 years ago

Currently, to get Cargo to retrigger when the frontend is changed, we recommend adding the frontend as a build-dependency. This works, but isn't strictly correct since the build.rs script doesn't use the frontend code at all.

build.rs scripts can tell Cargo about files that should trigger rebuilds with println!("cargo:rerun-if-changed={}", file);

We currently do this for the non-rust frontend code, like CSS. We should do this for all of the Rust code in the frontend, as well as the files for its dependencies (see the .d files in target/release/deps/, they seem like they probably have the info needed to do this)