mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-29 22:13:34 +03:00
fix(core): do not embed assets on dev when using a URL (#8739)
This commit is contained in:
parent
cb613beea6
commit
0a01b5b720
@ -157,30 +157,34 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
|||||||
options = options.with_csp();
|
options = options.with_csp();
|
||||||
}
|
}
|
||||||
|
|
||||||
let assets = match &config.build.frontend_dist {
|
let assets = if dev && config.build.dev_url.is_some() {
|
||||||
Some(url) => match url {
|
Default::default()
|
||||||
FrontendDist::Url(_url) => Default::default(),
|
} else {
|
||||||
FrontendDist::Dist(path) => {
|
match &config.build.frontend_dist {
|
||||||
let assets_path = config_parent.join(path);
|
Some(url) => match url {
|
||||||
if !assets_path.exists() {
|
FrontendDist::Url(_url) => Default::default(),
|
||||||
panic!(
|
FrontendDist::Dist(path) => {
|
||||||
"The `frontendDist` configuration is set to `{:?}` but this path doesn't exist",
|
let assets_path = config_parent.join(path);
|
||||||
path
|
if !assets_path.exists() {
|
||||||
)
|
panic!(
|
||||||
|
"The `frontendDist` configuration is set to `{:?}` but this path doesn't exist",
|
||||||
|
path
|
||||||
|
)
|
||||||
|
}
|
||||||
|
EmbeddedAssets::new(assets_path, &options, map_core_assets(&options, target))?
|
||||||
}
|
}
|
||||||
EmbeddedAssets::new(assets_path, &options, map_core_assets(&options, target))?
|
FrontendDist::Files(files) => EmbeddedAssets::new(
|
||||||
}
|
files
|
||||||
FrontendDist::Files(files) => EmbeddedAssets::new(
|
.iter()
|
||||||
files
|
.map(|p| config_parent.join(p))
|
||||||
.iter()
|
.collect::<Vec<_>>(),
|
||||||
.map(|p| config_parent.join(p))
|
&options,
|
||||||
.collect::<Vec<_>>(),
|
map_core_assets(&options, target),
|
||||||
&options,
|
)?,
|
||||||
map_core_assets(&options, target),
|
_ => unimplemented!(),
|
||||||
)?,
|
},
|
||||||
_ => unimplemented!(),
|
None => Default::default(),
|
||||||
},
|
}
|
||||||
None => Default::default(),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let out_dir = {
|
let out_dir = {
|
||||||
|
1
examples/api/dist/assets/index.css
vendored
1
examples/api/dist/assets/index.css
vendored
File diff suppressed because one or more lines are too long
43
examples/api/dist/assets/index.js
vendored
43
examples/api/dist/assets/index.js
vendored
File diff suppressed because one or more lines are too long
15
examples/api/dist/index.html
vendored
15
examples/api/dist/index.html
vendored
@ -1,15 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en" theme="dark">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>API Example App</title>
|
|
||||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
|
||||||
<link rel="stylesheet" href="/assets/index.css">
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
BIN
examples/api/dist/tauri_logo.png
vendored
BIN
examples/api/dist/tauri_logo.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 2.7 KiB |
Loading…
Reference in New Issue
Block a user