Prepare for upload

This commit is contained in:
Cecile Tonglet 2020-09-13 22:11:50 +02:00
parent 73902ea40d
commit 672b9eb75f
3 changed files with 10 additions and 5 deletions

View file

@ -9,6 +9,10 @@ edition = "2018"
[lib]
crate-type = ["cdylib"]
[features]
default = []
dev = []
[dependencies]
wasm-bindgen = "^0.2"
yew = { git = "https://github.com/yewstack/yew.git", rev = "1507c21b" }

2
dev.sh
View file

@ -1,3 +1,3 @@
#!/bin/sh
exec cargo watch -s './build.sh --dev && simple-http-server -i --nocache --cors' -w src
exec cargo watch -s './build.sh --dev -- --features dev && simple-http-server -i --nocache --cors' -w src

View file

@ -1,5 +1,6 @@
#![recursion_limit = "512"]
#[cfg(feature = "dev")]
mod app;
pub mod buttons;
pub mod collapse;
@ -7,8 +8,7 @@ pub mod forms;
pub mod icon;
pub mod tree;
use wasm_bindgen::prelude::*;
#[cfg(feature = "dev")]
#[macro_export]
macro_rules! log {
($s:expr $(,$args:expr)*) => {{
@ -16,8 +16,9 @@ macro_rules! log {
}};
}
#[wasm_bindgen(start)]
pub fn run_app() -> Result<(), JsValue> {
#[cfg(feature = "dev")]
#[wasm_bindgen::prelude::wasm_bindgen(start)]
pub fn run_app() -> Result<(), wasm_bindgen::JsValue> {
yew::start_app::<app::App>();
Ok(())