mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-26 21:41:48 +02:00
This commit is contained in:
@@ -41,14 +41,21 @@ fn main() {
|
|||||||
let window_url = WindowUrl::External(url);
|
let window_url = WindowUrl::External(url);
|
||||||
// rewrite the config so the IPC is enabled on this URL
|
// rewrite the config so the IPC is enabled on this URL
|
||||||
context.config_mut().build.dist_dir = AppUrl::Url(window_url.clone());
|
context.config_mut().build.dist_dir = AppUrl::Url(window_url.clone());
|
||||||
context.config_mut().build.dev_path = AppUrl::Url(window_url.clone());
|
|
||||||
|
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
.plugin(tauri_plugin_localhost::Builder::new(port).build())
|
.plugin(tauri_plugin_localhost::Builder::new(port).build())
|
||||||
.setup(move |app| {
|
.setup(move |app| {
|
||||||
WindowBuilder::new(app, "main".to_string(), window_url)
|
WindowBuilder::new(
|
||||||
.title("Localhost Example")
|
app,
|
||||||
.build()?;
|
"main".to_string(),
|
||||||
|
if cfg!(dev) {
|
||||||
|
Default::default()
|
||||||
|
} else {
|
||||||
|
window_url
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.title("Localhost Example")
|
||||||
|
.build()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.run(context)
|
.run(context)
|
||||||
|
|||||||
Reference in New Issue
Block a user