DioxusLabs / DioxusLabs/dioxus
Default platform setting for multi-target applications
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
## Feature Request
In multi-target fullstack setups like the template with fullstack enabled the `Cargo.toml` must have features for each platform like this:
```toml
[features]
desktop = ["dioxus/desktop"]
web = ["dioxus/web"]
mobile = ["dioxus/mobile"]
server = ["dioxus/server"]
```
During a `web` build, two binaries are built: the server with the `server` feature enabled and the client with the `web` feature enabled.
`web` should not be a default feature flag because that would enable the `web` feature during the server build. That could cause issues with user code with web-only logic gated behind that flag.
## Implement Suggestion
The CLI could read from a `default_platform` config with either web, desktop, or mobile to determine what platform to serve if `--platform` argument is set
Restore the `default_platform` setting that was removed in https://github.com/DioxusLabs/dioxus/pull/2975
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.