mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-02-17 06:08:26 +00:00
integrate with the bundle command
This commit is contained in:
parent
213b80790b
commit
9bfe9682b5
2 changed files with 15 additions and 2 deletions
|
@ -252,8 +252,6 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<BuildResult> {
|
|||
pub fn build_desktop(config: &CrateConfig, _is_serve: bool) -> Result<BuildResult> {
|
||||
log::info!("🚅 Running build [Desktop] command...");
|
||||
|
||||
let _gaurd = AssetConfigDropGaurd::new();
|
||||
|
||||
let t_start = std::time::Instant::now();
|
||||
let ignore_files = build_assets(config)?;
|
||||
|
||||
|
@ -353,6 +351,8 @@ pub fn build_desktop(config: &CrateConfig, _is_serve: bool) -> Result<BuildResul
|
|||
}
|
||||
}
|
||||
|
||||
// Collect assets
|
||||
process_assets(config)?;
|
||||
// Create the __assets_head.html file for bundling
|
||||
create_assets_head(&config)?;
|
||||
|
||||
|
|
|
@ -128,6 +128,19 @@ impl Bundle {
|
|||
}
|
||||
}
|
||||
|
||||
// Add all assets from collect assets to the bundle
|
||||
{
|
||||
let config = assets_cli_support::Config::current();
|
||||
let location = config.assets_serve_location().to_string();
|
||||
let location = format!("./{}", location);
|
||||
println!("Adding assets from {} to bundle", location);
|
||||
if let Some(resources) = &mut bundle_settings.resources {
|
||||
resources.push(location);
|
||||
} else {
|
||||
bundle_settings.resources = Some(vec![location]);
|
||||
}
|
||||
}
|
||||
|
||||
let mut settings = SettingsBuilder::new()
|
||||
.project_out_directory(crate_config.out_dir)
|
||||
.package_settings(PackageSettings {
|
||||
|
|
Loading…
Add table
Reference in a new issue