mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 04:33:06 +00:00
fix release desktop builds
This commit is contained in:
parent
62f8e0f727
commit
213b80790b
2 changed files with 12 additions and 2 deletions
|
@ -9,7 +9,7 @@ use indicatif::{ProgressBar, ProgressStyle};
|
|||
use serde::Serialize;
|
||||
use std::{
|
||||
fs::{copy, create_dir_all, File},
|
||||
io::Read,
|
||||
io::{Read, Write},
|
||||
panic,
|
||||
path::PathBuf,
|
||||
time::Duration,
|
||||
|
@ -353,6 +353,9 @@ pub fn build_desktop(config: &CrateConfig, _is_serve: bool) -> Result<BuildResul
|
|||
}
|
||||
}
|
||||
|
||||
// Create the __assets_head.html file for bundling
|
||||
create_assets_head(&config)?;
|
||||
|
||||
log::info!(
|
||||
"🚩 Build completed: [./{}]",
|
||||
config
|
||||
|
@ -372,6 +375,13 @@ pub fn build_desktop(config: &CrateConfig, _is_serve: bool) -> Result<BuildResul
|
|||
})
|
||||
}
|
||||
|
||||
fn create_assets_head(config: &CrateConfig) -> Result<()> {
|
||||
let manifest = config.asset_manifest();
|
||||
let mut file = File::create(config.out_dir.join("__assets_head.html"))?;
|
||||
file.write_all(manifest.head().as_bytes())?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn prettier_build(cmd: subprocess::Exec) -> anyhow::Result<Vec<Diagnostic>> {
|
||||
let mut warning_messages: Vec<Diagnostic> = vec![];
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ pub fn build(
|
|||
}
|
||||
#[cfg(not(debug_assertions))]
|
||||
{
|
||||
std::fs::read_to_string("public/assets_head.html").ok()
|
||||
std::fs::read_to_string("dist/__assets_head.html").ok()
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue