Messing around with leptos SSR to see if it's able to work for our use-cases.
1[package]
2name = "leptos-sounds-like-a-disease"
3version = "0.1.0"
4edition = "2021"
5
6[lib]
7crate-type = ["cdylib", "rlib"]
8
9[dependencies]
10leptos = { version = "0.7.0" }
11leptos_router = { version = "0.7.0" }
12axum = { version = "0.7", optional = true }
13console_error_panic_hook = { version = "0.1", optional = true}
14leptos_axum = { version = "0.7.0", optional = true }
15leptos_meta = { version = "0.7.0" }
16tokio = { version = "1", features = ["rt-multi-thread"], optional = true }
17wasm-bindgen = { version = "=0.2.100", optional = true }
18
19[features]
20hydrate = [
21 "leptos/hydrate",
22 "dep:console_error_panic_hook",
23 "dep:wasm-bindgen",
24]
25ssr = [
26 "dep:axum",
27 "dep:tokio",
28 "dep:leptos_axum",
29 "leptos/ssr",
30 "leptos_meta/ssr",
31 "leptos_router/ssr",
32]
33
34# Defines a size-optimized profile for the WASM bundle in release mode
35[profile.wasm-release]
36inherits = "release"
37opt-level = 'z'
38lto = true
39codegen-units = 1
40panic = "abort"
41
42[package.metadata.leptos]
43# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
44output-name = "leptos-sounds-like-a-disease"
45
46# The site root folder is where cargo-leptos generate all output. WARNING: all content of this folder will be erased on a rebuild. Use it in your server setup.
47site-root = "target/site"
48
49# The site-root relative folder where all compiled output (JS, WASM and CSS) is written
50# Defaults to pkg
51site-pkg-dir = "pkg"
52
53# [Optional] The source CSS file. If it ends with .sass or .scss then it will be compiled by dart-sass into CSS. The CSS is optimized by Lightning CSS before being written to <site-root>/<site-pkg>/app.css
54style-file = "style/main.scss"
55# Assets source dir. All files found here will be copied and synchronized to site-root.
56# The assets-dir cannot have a sub directory with the same name/path as site-pkg-dir.
57#
58# Optional. Env: LEPTOS_ASSETS_DIR.
59assets-dir = "public"
60
61# The IP and port (ex: 127.0.0.1:3000) where the server serves the content. Use it in your server setup.
62site-addr = "127.0.0.1:3000"
63
64# The port to use for automatic reload monitoring
65reload-port = 3001
66
67# [Optional] Command to use when running end2end tests. It will run in the end2end dir.
68# [Windows] for non-WSL use "npx.cmd playwright test"
69# This binary name can be checked in Powershell with Get-Command npx
70end2end-cmd = "npx playwright test"
71end2end-dir = "end2end"
72
73# The browserlist query used for optimizing the CSS.
74browserquery = "defaults"
75
76# The environment Leptos will run in, usually either "DEV" or "PROD"
77env = "DEV"
78
79# The features to use when compiling the bin target
80#
81# Optional. Can be over-ridden with the command line parameter --bin-features
82bin-features = ["ssr"]
83
84# If the --no-default-features flag should be used when compiling the bin target
85#
86# Optional. Defaults to false.
87bin-default-features = false
88
89# The features to use when compiling the lib target
90#
91# Optional. Can be over-ridden with the command line parameter --lib-features
92lib-features = ["hydrate"]
93
94# If the --no-default-features flag should be used when compiling the lib target
95#
96# Optional. Defaults to false.
97lib-default-features = false
98
99# The profile to use for the lib target when compiling for release
100#
101# Optional. Defaults to "release".
102lib-profile-release = "wasm-release"