integrate with the bundle command
This commit is contained in:
1 parent
213b80790b
commit
9bfe9682b5
2 files changed
+15
-2
No files matched your search
@@ -252,8 +252,6 @@ pub fn build(config: &CrateConfig, quiet: bool) -> Result<BuildResult> {
|
|||||||
pub fn build_desktop(config: &CrateConfig, _is_serve: bool) -> Result<BuildResult> {
|
pub fn build_desktop(config: &CrateConfig, _is_serve: bool) -> Result<BuildResult> {
|
||||||
log::info!("🚅 Running build [Desktop] command...");
|
log::info!("🚅 Running build [Desktop] command...");
|
||||||
|
|
||||||
let _gaurd = AssetConfigDropGaurd::new();
|
|
||||||
|
|
||||||
let t_start = std::time::Instant::now();
|
let t_start = std::time::Instant::now();
|
||||||
let ignore_files = build_assets(config)?;
|
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 the __assets_head.html file for bundling
|
||||||
create_assets_head(&config)?;
|
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()
|
let mut settings = SettingsBuilder::new()
|
||||||
.project_out_directory(crate_config.out_dir)
|
.project_out_directory(crate_config.out_dir)
|
||||||
.package_settings(PackageSettings {
|
.package_settings(PackageSettings {
|
||||||
|
|||||||
Reference in new issue
Block a user