diff --git a/packages/cli/src/builder.rs b/packages/cli/src/builder.rs index 7b5527d2a..bed075ad6 100644 --- a/packages/cli/src/builder.rs +++ b/packages/cli/src/builder.rs @@ -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 Result 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> { let mut warning_messages: Vec = vec![]; diff --git a/packages/desktop/src/webview.rs b/packages/desktop/src/webview.rs index 49475e903..118dbbdc4 100644 --- a/packages/desktop/src/webview.rs +++ b/packages/desktop/src/webview.rs @@ -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() } };