leptos-rs / cargo-leptos

Build tool for Leptos (Rust)
MIT License
314 stars 87 forks source link

`cargo leptos watch` ignores `bin-target-tripple` #242

Open DylanRJohnston opened 3 months ago

DylanRJohnston commented 3 months ago

When running cargo leptos watch building the server ignores the bin-target-tripple configuration.

I'm trying to explore if cargo leptos watch can integrate well with deploying to Cloudflare workers which is a wasm32-unknown-unknown target. Building works fine, but the watch subcommand ignores the bin-target-tripple configuration option.

DylanRJohnston commented 3 months ago

Setting LEPTOS_BIN_TARGET_TRIPLE="wasm32-unknown-unknown" works as expected however it then errors after compilation trying to watch target/wasm32-unknown-unknown/debug/server as it's missing the .wasm extension.

benwis commented 3 months ago

The problem with this is that there is no native way to run a wasm server. We’d have to bundle wasmtime or washer, and so far no one has expressed interest in doing that

On Sat, Jan 20, 2024, at 6:23 PM, Dylan R. Johnston wrote:

Setting LEPTOS_BIN_TARGET_TRIPLE="wasm32-unknown-unknown" works as expected however it then errors after compilation trying to watch target/wasm32-unknown-unknown/debug/server as it's missing the .wasm extension.

— Reply to this email directly, view it on GitHub https://github.com/leptos-rs/cargo-leptos/issues/242#issuecomment-1902481144, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVBTCNNQ6JMN4RCT52MGC3YPR32JAVCNFSM6AAAAABCDT4LR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBSGQ4DCMJUGQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

DanielJoyce commented 3 months ago

One quick question... Are you using the right key name, because every time you mention it here, its mispelled.

bin-tripple-target

DylanRJohnston commented 3 months ago

Apologies @DanielJoyce, I can confirm I was using the bin-target-tripple = "wasm32-unknown-unknown" in the configuration.

DylanRJohnston commented 3 months ago

@benwis what about a simple way to override the server command with an arbitrary command? That would let me launch wranger dev appropriately after building and still make use of the hot reloading of CSS, etc.