From 409fb968d3bf2b07fdbfebf0e74702f8f02cf6c2 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 10 Feb 2023 17:56:10 +0100 Subject: [PATCH] add cargo config file that sets --cfg=web_sys_unstable_apis on wasm32 --- .cargo/config.toml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..be614b00 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,6 @@ +# clipboard api is still unstable, so web-sys requires the below flag to be passed for copy (ctrl + c) to work +# https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html +# check status at https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility +# we don't use `[build]` because of rust analyzer's build cache invalidation https://github.com/emilk/eframe_template/issues/93 +[target.wasm32-unknown-unknown] +rustflags = ["--cfg=web_sys_unstable_apis"]