Revision: Cleanup Dioxus.toml (#3802)
* revision: remove unused config options * remove: unsused icon
This commit is contained in:
1 parent
8dbb652628
commit
7c2cea9df7
3 files changed
+3
-23
No files matched your search
@@ -1,22 +1,11 @@
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
# dioxus project name
|
|
||||||
name = "{{project-name}}"
|
|
||||||
|
|
||||||
# default platform
|
|
||||||
# you can also use `dx serve/build --platform XXX` to use other platform
|
|
||||||
# value: web | desktop
|
|
||||||
default_platform = "{{default-platform}}"
|
|
||||||
|
|
||||||
# Web `build` & `serve` dist path
|
# Web `build` & `serve` dist path
|
||||||
out_dir = "dist"
|
out_dir = "dist"
|
||||||
|
|
||||||
# resource (static) file folder
|
# resource (static) file folder
|
||||||
asset_dir = "public"
|
asset_dir = "public"
|
||||||
|
|
||||||
# hot reload by default
|
|
||||||
hot_reload = true
|
|
||||||
|
|
||||||
[web.wasm_opt]
|
[web.wasm_opt]
|
||||||
# The level wasm-opt should target. z is the smallest. 4 is the fastest.
|
# The level wasm-opt should target. z is the smallest. 4 is the fastest.
|
||||||
level = "4"
|
level = "4"
|
||||||
@@ -32,7 +21,7 @@ index_on_404 = true
|
|||||||
|
|
||||||
watch_path = ["src", "examples"]
|
watch_path = ["src", "examples"]
|
||||||
|
|
||||||
[bundler]
|
[bundle]
|
||||||
# Bundle identifier
|
# Bundle identifier
|
||||||
identifier = "io.github.{{project-name}}"
|
identifier = "io.github.{{project-name}}"
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 130 KiB |
@@ -14,10 +14,6 @@ pub(crate) enum Config {
|
|||||||
#[clap(long)]
|
#[clap(long)]
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
force: bool,
|
force: bool,
|
||||||
|
|
||||||
/// Project default platform
|
|
||||||
#[clap(long, default_value = "web")]
|
|
||||||
platform: String,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/// Format print Dioxus config.
|
/// Format print Dioxus config.
|
||||||
@@ -78,11 +74,7 @@ impl Config {
|
|||||||
pub(crate) fn config(self) -> Result<StructuredOutput> {
|
pub(crate) fn config(self) -> Result<StructuredOutput> {
|
||||||
let crate_root = crate_root()?;
|
let crate_root = crate_root()?;
|
||||||
match self {
|
match self {
|
||||||
Config::Init {
|
Config::Init { name, force } => {
|
||||||
name,
|
|
||||||
force,
|
|
||||||
platform,
|
|
||||||
} => {
|
|
||||||
let conf_path = crate_root.join("Dioxus.toml");
|
let conf_path = crate_root.join("Dioxus.toml");
|
||||||
if conf_path.is_file() && !force {
|
if conf_path.is_file() && !force {
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
@@ -92,8 +84,7 @@ impl Config {
|
|||||||
}
|
}
|
||||||
let mut file = File::create(conf_path)?;
|
let mut file = File::create(conf_path)?;
|
||||||
let content = String::from(include_str!("../../assets/dioxus.toml"))
|
let content = String::from(include_str!("../../assets/dioxus.toml"))
|
||||||
.replace("{{project-name}}", &name)
|
.replace("{{project-name}}", &name);
|
||||||
.replace("{{default-platform}}", &platform);
|
|
||||||
file.write_all(content.as_bytes())?;
|
file.write_all(content.as_bytes())?;
|
||||||
tracing::info!(dx_src = ?TraceSrc::Dev, "🚩 Init config file completed.");
|
tracing::info!(dx_src = ?TraceSrc::Dev, "🚩 Init config file completed.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user