refactor(cli-config): modified CrateConfig struct
`out_dir` and `asset_dir` are now methods, because they derive from `crate_dir` and `dioxus_config`.
This commit is contained in:
7 files changed
+49
-42
No files matched your search
@@ -13,7 +13,7 @@ pub fn asset_manifest(crate_config: &CrateConfig) -> AssetManifest {
|
||||
|
||||
/// Create a head file that contains all of the imports for assets that the user project uses
|
||||
pub fn create_assets_head(config: &CrateConfig, manifest: &AssetManifest) -> Result<()> {
|
||||
let mut file = File::create(config.out_dir.join("__assets_head.html"))?;
|
||||
let mut file = File::create(config.out_dir().join("__assets_head.html"))?;
|
||||
file.write_all(manifest.head().as_bytes())?;
|
||||
Ok(())
|
||||
}
|
||||
@@ -29,7 +29,7 @@ pub(crate) fn process_assets(config: &CrateConfig, manifest: &AssetManifest) ->
|
||||
.clone()
|
||||
.unwrap_or_default(),
|
||||
);
|
||||
let static_asset_output_dir = config.out_dir.join(static_asset_output_dir);
|
||||
let static_asset_output_dir = config.out_dir().join(static_asset_output_dir);
|
||||
|
||||
manifest.copy_static_assets_to(static_asset_output_dir)?;
|
||||
|
||||
|
||||
Reference in new issue
Block a user