diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-05-28 13:18:59 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-05-28 13:18:59 -0400 |
| commit | 4734dfca27bf9d498f3e9b3e42c7a5c01a188237 (patch) | |
| tree | 0519c09f5ef2f82ee7462872f71b9c08f24561cd /src/ui | |
| parent | 79d3598282fd573931e7cb14e4d3e54aad7c943c (diff) | |
Build the Sveltekit UI into Cargo's OUT_DIR.
This has a couple of material consequences:
* It will be (much) easier to reorganize the source tree, as the path to the output is no longer relative to where the config files are when building the final binary. If we do decide to move `ui` into its own child crate, we won't have to make a bunch of (very similar) changes to the Svelte build process at that time.
* There is less chance of a stale build contaminating a new one, since changes to the crate change the project hash in `OUT_DIR`. For example, while working on this change, `OUT_DIR` was at various points:
* `target/debug/build/pilcrow-7cfeef3536ddd3e7/out`
* `target/debug/build/pilcrow-09d4ddbc12bef36b/out`
* `target/release/build/pilcrow-070d373bd5f850a1`
This may use more space on disk, but it's all reclaimable with `cargo clean` and Rust is _far_ more profligate with disk space than Svelte will ever be.
* It's more consistent with Cargo's expectations around generated source files, and thus potentially easier to onboard Rust developers into.
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/assets.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ui/assets.rs b/src/ui/assets.rs index 642679b..0ca9593 100644 --- a/src/ui/assets.rs +++ b/src/ui/assets.rs @@ -9,7 +9,7 @@ use super::{error::NotFound, mime}; use crate::error::Internal; #[derive(rust_embed::Embed)] -#[folder = "target/ui"] +#[folder = "$OUT_DIR/ui"] pub struct Assets; impl Assets { |
