Support for Leptos for Cloudflare Pages?

Hi, I have a site I’ve built (client side rendering) using Leptos and would like to host it using Cloudflare Pages. Is there support for cargo/Rust and trunk?

This is the current command I’m running to build, though this takes quite a while of course:

npm install -g tailwindcss && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && . "$HOME/.cargo/env" && rustup toolchain install nightly --profile minimal && rustup default nightly && rustup target add wasm32-unknown-unknown && cargo install --locked trunk && trunk build

AFAIK Rust/cargo and trunk are not supported by default. Here a overview of all supported frameworks: Build configuration · Cloudflare Pages docs

So you would need to install the required frameworks/languages by yourself and then build. Taking into consideration you want to use Rust you could run into the 20min build-timeout - depending on how big your project is. Limits · Cloudflare Pages docs

1 Like

Alright, fair enough, thank you. I’ll just leave that command above for anyone else who happens to come across this, as it actually does work for me. Just need the --release at the end, so the full command is:

npm install -g tailwindcss && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && . "$HOME/.cargo/env" && rustup toolchain install nightly --profile minimal && rustup default nightly && rustup target add wasm32-unknown-unknown && cargo install --locked trunk && trunk build --release

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.