-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cargo.toml
70 lines (60 loc) · 1.83 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
[package]
name = "{{crate_name}}"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib"]
[dependencies]
console_error_panic_hook = "0.1.7"
wasi = { version = "0.13.3", optional = true }
hydration_context = { git = "https://github.com/leptos-rs/leptos" }
leptos = { git = "https://github.com/leptos-rs/leptos" }
leptos_meta = { git = "https://github.com/leptos-rs/leptos" }
leptos_router = { git = "https://github.com/leptos-rs/leptos" }
leptos_wasi = { git = "https://github.com/leptos-rs/leptos_wasi", optional = true }
wasm-bindgen = { version = "0.2.95", optional = true }
[features]
# This is your client-side feature.
hydrate = [
"leptos/hydrate",
"dep:wasm-bindgen",
]
# This is your server-side feature.
ssr = [
"leptos/ssr",
"leptos_meta/ssr",
"leptos_router/ssr",
"dep:leptos_wasi",
"dep:wasi",
]
# Defines a size-optimized profile for the WASM bundle in release mode.
[profile.wasm-release]
inherits = "release"
opt-level = 'z'
lto = true
codegen-units = 1
panic = "abort"
[package.metadata.leptos]
# Assets source dir. All files found here will be copied and synchronized to site-root.
# The assets-dir cannot have a sub directory with the same name/path as site-pkg-dir.
#
# Optional. Env: LEPTOS_ASSETS_DIR.
assets-dir = "public"
# == Hydrate (client)
lib-profile-release = "wasm-release"
lib-features = ["hydrate"]
# ==== Rebuild the std crates using the optimized profile.
lib-cargo-args = [
"-Zbuild-std=std,panic_abort,core,alloc",
"-Zbuild-std-features=panic_immediate_abort",
]
# == SSR
bin-profile-release = "wasm-release"
bin-target-triple = "wasm32-wasip2"
bin-features = ["ssr"]
bin-target-dir = "{{component_outdir}}"
# ==== Rebuild the std crates using the optimized profile.
bin-cargo-args = [
"-Zbuild-std=std,panic_abort,core,alloc",
"-Zbuild-std-features=panic_immediate_abort,wasi_ext",
]