diff --git a/docs/book/post_build.py b/docs/book/post_build.py index 61a9909..9383748 100644 --- a/docs/book/post_build.py +++ b/docs/book/post_build.py @@ -19,7 +19,7 @@ def build_and_copy_demo(category, md_name): name = md_name[:-3] example_dir = f"../../examples/{name}" if os.path.exists(example_dir): - p = subprocess.Popen(["trunk", "build"], cwd=example_dir) + p = subprocess.Popen(["trunk", "build", "--release"], cwd=example_dir) p.wait() example_output_path = os.path.join(example_dir, "dist") diff --git a/examples/.cargo/config.toml b/examples/.cargo/config.toml index 8467175..c841b61 100644 --- a/examples/.cargo/config.toml +++ b/examples/.cargo/config.toml @@ -1,2 +1,6 @@ [build] -rustflags = ["--cfg=web_sys_unstable_apis"] +rustflags = ["--cfg=web_sys_unstable_apis", "--cfg=has_std"] + +[unstable] +build-std = ["std", "panic_abort", "core", "alloc"] +build-std-features = ["panic_immediate_abort"] \ No newline at end of file diff --git a/examples/Cargo.toml b/examples/Cargo.toml index d70b09d..5ec52d0 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -31,4 +31,20 @@ members = [ "watch_debounced", "watch_pausable", "watch_throttled", -] \ No newline at end of file +] + +[package] +name = "leptos-use-examples" +version = "0.3.3" +edition = "2021" + +[profile.release] +opt-level = 'z' +lto = true +codegen-units = 1 +panic = "abort" + +[lib] + +[package.metadata.leptos] +lib-profile-release = "wasm-release" diff --git a/examples/src/lib.rs b/examples/src/lib.rs new file mode 100644 index 0000000..506d67d --- /dev/null +++ b/examples/src/lib.rs @@ -0,0 +1 @@ +// necessary to be able to specify a release profile in the workspace root Cargo.toml