主干
Trunk 是一个用于 Rust 的 WASM 网络应用打包工具。更多关于 Trunk 的信息,请访问 https://trunk-rs.github.io/trunk/。本指南适用于 Trunk 0.17.5 版本。
🌐 Trunk is a WASM web application bundler for Rust. Learn more about Trunk at https://trunk-rs.github.io/trunk/. This guide is accurate as of Trunk 0.17.5.
🌐 Checklist
- 使用 SSG,Tauri 不正式支持基于服务器的解决方案。
- 使用
serve.ws_protocol = "ws",以便热重载 WebSocket 能够正确连接,用于移动开发。 - 启用
withGlobalTauri以确保 Tauri API 可在window.__TAURI__变量中使用,并且可以使用wasm-bindgen导入。
🌐 Example Configuration
-
tauri.conf.json {"build": {"beforeDevCommand": "trunk serve","beforeBuildCommand": "trunk build","devUrl": "http://localhost:8080","frontendDist": "../dist"},"app": {"withGlobalTauri": true}} -
Trunk.toml [watch]ignore = ["./src-tauri"][serve]ws_protocol = "ws"
Tauri 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站