-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Option to only build front end / CSR or backend / SSR #315
Comments
I'm currently rewriting cargo-leptos, and that will be a feature. In the meantime, a workaround is to call wasm-pack or wasm-bindgen directly as we recommend in the example readmes |
If you really want this behavior in the meantime, #318 actually implements this. The invocation would be |
How should I call EDIT: aha! after much debugging and staring at the source, turns out my issue was that I was optimizing the wasm prior to packing it, which I think removed some crucial instructions. The steps I ended up with are essentially just these (but not quite, as I'm doing it with nix derivations and ipetkov/crane)
I'm using minify as opposed to swc's minify, as swc's CLI isn't properly implemented yet, and I was doing this all from scripted bash. |
I am trying to develop a Dockerfile using
cargo leptos
and only need to build the server binary in the docker container. There is no need to build the front end, i.e. the .html, .css, and .wasm files inside the docker container, so I am wanting to build them on my local machine and use that build toCOPY target/site set
into the docker container.But, because I build the .wasm file with
--release
, when I runcargo leptos build --release
I build both the .wasm (what I want) and the SSR binary (what I don't need). Can we add a CLI flag / option to only build the front end? This functionality is much harder to extract, but for my docker container I have hand-crafted acargo build --target=wasm32-unknown-unknown
invocation.Currently I can just ^C the
cargo leptos build
process after it has built just the front end, but I would eventually like to script this, so having an option likecargo leptos build --release --front-end-only
would helpThe text was updated successfully, but these errors were encountered: