feat: add default_platform config

This commit is contained in:
mrxiaozhuox committed 2022-02-09 21:11:41 +08:00
1 parent 1835a25e03
commit 59ebb9ec11
5 files changed
+39 -18

No files matched your search

+14 -2
View File
@@ -1,5 +1,9 @@
use crate::{cfg::ConfigOptsServe, gen_page, server, CrateConfig};
use std::{io::Write, path::PathBuf, process::{Command, Stdio}};
use std::{
io::Write,
path::PathBuf,
process::{Command, Stdio},
};
use structopt::StructOpt;
/// Run the WASM project on dev-server
@@ -21,7 +25,15 @@ impl Serve {
crate_config.as_example(self.serve.example.unwrap());
}
match self.serve.platform.as_str() {
let platform = self.serve.platform.unwrap_or_else(|| {
crate_config
.dioxus_config
.application
.default_platform
.clone()
});
match platform.as_str() {
"web" => {
crate::builder::build(&crate_config)?;
}