remove: default_platform toml field (#3108)
This commit is contained in:
1 parent
d3404bd13a
commit
8a0eca1c8a
4 files changed
-18
No files matched your search
@@ -3,9 +3,6 @@
|
|||||||
# App name
|
# App name
|
||||||
name = "project_name"
|
name = "project_name"
|
||||||
|
|
||||||
# The Dioxus platform to default to
|
|
||||||
default_platform = "web"
|
|
||||||
|
|
||||||
# `build` & `serve` output path
|
# `build` & `serve` output path
|
||||||
out_dir = "dist"
|
out_dir = "dist"
|
||||||
|
|
||||||
|
|||||||
@@ -33,12 +33,6 @@ Note: The CLI will fail to build projects in debug profile. This is currently un
|
|||||||
cargo install --path .
|
cargo install --path .
|
||||||
```
|
```
|
||||||
|
|
||||||
### Developing The CLI
|
|
||||||
It's faster to build the CLI using the `cli-dev` profile when testing changes.
|
|
||||||
```shell
|
|
||||||
cargo build --profile cli-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
## Get started
|
## Get started
|
||||||
|
|
||||||
Use `dx new` to initialize a new Dioxus project.
|
Use `dx new` to initialize a new Dioxus project.
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
use crate::Platform;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub(crate) struct ApplicationConfig {
|
pub(crate) struct ApplicationConfig {
|
||||||
#[serde(default = "default_platform")]
|
|
||||||
pub(crate) default_platform: Platform,
|
|
||||||
|
|
||||||
#[serde(default = "asset_dir_default")]
|
#[serde(default = "asset_dir_default")]
|
||||||
pub(crate) asset_dir: PathBuf,
|
pub(crate) asset_dir: PathBuf,
|
||||||
|
|
||||||
@@ -14,10 +10,6 @@ pub(crate) struct ApplicationConfig {
|
|||||||
pub(crate) sub_package: Option<String>,
|
pub(crate) sub_package: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn default_platform() -> Platform {
|
|
||||||
Platform::Web
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn asset_dir_default() -> PathBuf {
|
pub(crate) fn asset_dir_default() -> PathBuf {
|
||||||
PathBuf::from("assets")
|
PathBuf::from("assets")
|
||||||
}
|
}
|
||||||
@@ -22,7 +22,6 @@ impl Default for DioxusConfig {
|
|||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
application: ApplicationConfig {
|
application: ApplicationConfig {
|
||||||
default_platform: default_platform(),
|
|
||||||
asset_dir: asset_dir_default(),
|
asset_dir: asset_dir_default(),
|
||||||
sub_package: None,
|
sub_package: None,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user