mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-22 16:49:22 -05:00
building examples now uses a wasm binary size optimized release build
This commit is contained in:
parent
8e60515c40
commit
1abff6a4f2
4 changed files with 24 additions and 3 deletions
|
@ -19,7 +19,7 @@ def build_and_copy_demo(category, md_name):
|
||||||
name = md_name[:-3]
|
name = md_name[:-3]
|
||||||
example_dir = f"../../examples/{name}"
|
example_dir = f"../../examples/{name}"
|
||||||
if os.path.exists(example_dir):
|
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()
|
p.wait()
|
||||||
|
|
||||||
example_output_path = os.path.join(example_dir, "dist")
|
example_output_path = os.path.join(example_dir, "dist")
|
||||||
|
|
|
@ -1,2 +1,6 @@
|
||||||
[build]
|
[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"]
|
|
@ -31,4 +31,20 @@ members = [
|
||||||
"watch_debounced",
|
"watch_debounced",
|
||||||
"watch_pausable",
|
"watch_pausable",
|
||||||
"watch_throttled",
|
"watch_throttled",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[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"
|
||||||
|
|
1
examples/src/lib.rs
Normal file
1
examples/src/lib.rs
Normal file
|
@ -0,0 +1 @@
|
||||||
|
// necessary to be able to specify a release profile in the workspace root Cargo.toml
|
Loading…
Add table
Reference in a new issue