mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-02-17 14:18:27 +00:00
Merge pull request #23 from naturalethic/configure-package
Allow package configuration
This commit is contained in:
commit
524f97a51a
1 changed files with 7 additions and 1 deletions
|
@ -34,6 +34,7 @@ impl Default for DioxusConfig {
|
|||
default_platform: "web".to_string(),
|
||||
out_dir: Some(PathBuf::from("dist")),
|
||||
asset_dir: Some(PathBuf::from("public")),
|
||||
sub_package: None,
|
||||
},
|
||||
web: WebConfig {
|
||||
app: WebAppConfing {
|
||||
|
@ -62,6 +63,7 @@ pub struct ApplicationConfig {
|
|||
pub default_platform: String,
|
||||
pub out_dir: Option<PathBuf>,
|
||||
pub asset_dir: Option<PathBuf>,
|
||||
pub sub_package: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
@ -119,7 +121,11 @@ impl CrateConfig {
|
|||
pub fn new() -> Result<Self> {
|
||||
let dioxus_config = DioxusConfig::load()?;
|
||||
|
||||
let crate_dir = crate::cargo::crate_root()?;
|
||||
let crate_dir = if let Some(package) = &dioxus_config.application.sub_package {
|
||||
crate::cargo::crate_root()?.join(package)
|
||||
} else {
|
||||
crate::cargo::crate_root()?
|
||||
};
|
||||
let meta = crate::cargo::Metadata::get()?;
|
||||
let workspace_dir = meta.workspace_root;
|
||||
let target_dir = meta.target_directory;
|
||||
|
|
Loading…
Add table
Reference in a new issue