How to deploy CSR to Netlify? #4371
-
|
Hi 👋 the docs have instructions for GitHub Pages and Vercel, however, I use Netlify and I'm unsure 1) how to deploy a CSR app, and 2) does it support it and that's why it's missing? Help appreciated! ps: if this work, I'll submit a doc update if welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
|
I have never used Netlify (or GitHub Pages or Vercel, for that matter) but I would assume it's the same as deploying any SPA to the same service. i.e., you use |
Beta Was this translation helpful? Give feedback.
-
|
hi @gbj , this is all it takes and I'd be ready to contribute it as PR to Leptos Book, with one remaining question? Do I need the example repo? Thanks. NetlifyAll it takes to deploy a Leptos CSR app to Netlify is to create a project and to Configuration FilesCreate a [build]
command = "rustup target add wasm32-unknown-unknown && cargo install trunk --locked && trunk build --release"
publish = "dist"
[build.environment]
RUST_VERSION = "stable"
[[redirects]]
from = "/*"
to = "/index.html"
status = 200Create a [toolchain]
channel = "stable"
targets = ["wasm32-unknown-unknown"]Deployment
The |
Beta Was this translation helpful? Give feedback.
-
|
closing as solved (not being rude, but one less worry for you) |
Beta Was this translation helpful? Give feedback.
I have never used Netlify (or GitHub Pages or Vercel, for that matter) but I would assume it's the same as deploying any SPA to the same service. i.e., you use
trunk build --release, which fils adist/directory with all the files you need to deploy, which you can then deploy to Netlify however that's normally done. Feel free to contribute to the book with any Netlify-specific config that's needed.