mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-11-28 12:27:16 +03:00
Fix/includedir (#751)
* fix(tauri) assets embedding regression * fix(tauri) fix & optimize embedded assets
This commit is contained in:
parent
e8ecd3ce3f
commit
c3b5c1fdf8
6
.changes/assets-fix.md
Normal file
6
.changes/assets-fix.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
"tauri.js": patch
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Fixes the assets embedding into the binary.
|
@ -141,7 +141,7 @@ class Runner {
|
||||
inlinedAssets = (await this.__parseHtml(cfg, devPath)).inlinedAssets
|
||||
}
|
||||
|
||||
process.env.TAURI_INLINED_ASSSTS = inlinedAssets.join('|')
|
||||
process.env.TAURI_INLINED_ASSETS = inlinedAssets.join('|')
|
||||
|
||||
this.devPath = devPath
|
||||
|
||||
@ -225,7 +225,7 @@ class Runner {
|
||||
this.__rewriteManifest(cargoManifest)
|
||||
|
||||
const inlinedAssets = (await this.__parseHtml(cfg, cfg.build.distDir)).inlinedAssets
|
||||
process.env.TAURI_INLINED_ASSSTS = inlinedAssets.join('|')
|
||||
process.env.TAURI_INLINED_ASSETS = inlinedAssets.join('|')
|
||||
|
||||
const features = [
|
||||
cfg.tauri.embeddedServer.active ? 'embedded-server' : 'no-server'
|
||||
|
@ -36,7 +36,7 @@ once_cell = "1.4.0"
|
||||
tauri-api = { version = "0.7", path = "../tauri-api" }
|
||||
|
||||
[build-dependencies]
|
||||
tauri_includedir_codegen = "0.6.1"
|
||||
tauri_includedir_codegen = "0.6.2"
|
||||
cfg_aliases = "0.1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
|
@ -24,15 +24,24 @@ pub fn main() -> Result<(), Box<dyn Error>> {
|
||||
|
||||
println!("cargo:rerun-if-changed={}", dist_path_string);
|
||||
|
||||
let inlined_assets = match std::env::var_os("TAURI_INLINED_ASSETS") {
|
||||
let mut inlined_assets = match std::env::var_os("TAURI_INLINED_ASSETS") {
|
||||
Some(assets) => assets
|
||||
.into_string()
|
||||
.unwrap()
|
||||
.split('|')
|
||||
.map(|s| s.to_string())
|
||||
.filter(|s| s != "")
|
||||
.collect(),
|
||||
None => Vec::new(),
|
||||
};
|
||||
|
||||
// the index.html is parsed so we always ignore it
|
||||
inlined_assets.push("index.html".to_string());
|
||||
if cfg!(feature = "no-server") {
|
||||
// on no-server we include_str() the index.tauri.html on the runner
|
||||
inlined_assets.push("index.tauri.html".to_string());
|
||||
}
|
||||
|
||||
// include assets
|
||||
tauri_includedir_codegen::start("ASSETS")
|
||||
.dir(
|
||||
|
Loading…
Reference in New Issue
Block a user