How to add a target-specific patch?

Hi all,
I need to patch a crate only for a specific target, is this possible?

# This should only apply when compiling for wasm32
crate =  { path = "path/to/crate" }

No, I don't think it's possible to do directly.

The best you can do is to make the patched crate contain different code conditionally, either with #[cfg()] or by using target-specific dependencies itself.