diff --git a/packages/config-macro/src/lib.rs b/packages/config-macro/src/lib.rs index f7605ee37..245fbab4a 100644 --- a/packages/config-macro/src/lib.rs +++ b/packages/config-macro/src/lib.rs @@ -36,6 +36,21 @@ pub fn client(input: TokenStream) -> TokenStream { .into() } +#[proc_macro] +pub fn web(input: TokenStream) -> TokenStream { + if cfg!(feature = "web") { + let input = TokenStream2::from(input); + quote! { + Some(#input) + } + } else { + quote! { + None + } + } + .into() +} + #[proc_macro] pub fn desktop(input: TokenStream) -> TokenStream { if cfg!(feature = "desktop") {