<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>5 前端配置 on 编程那些事儿</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/</link><description>Recent content in 5 前端配置 on 编程那些事儿</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Fri, 25 Sep 2026 23:46:06 +0800</lastBuildDate><atom:link href="https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/index.xml" rel="self" type="application/rss+xml"/><item><title>6 Vite</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/6-vite/</link><pubDate>Fri, 25 Sep 2026 21:31:08 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/6-vite/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://tauri.app/start/frontend/vite/"&gt;https://tauri.app/start/frontend/vite/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Vite 是一个构建工具，致力于为现代 Web 项目提供更快、更精简的开发体验。
本指南基于 Vite 8。&lt;/p&gt;
&lt;h2 id="检查清单"&gt;检查清单&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;在 &lt;code&gt;src-tauri/tauri.conf.json&lt;/code&gt; 中使用 &lt;code&gt;../dist&lt;/code&gt; 作为 &lt;code&gt;frontendDist&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;在 iOS 真机上运行时，使用 &lt;code&gt;process.env.TAURI_DEV_HOST&lt;/code&gt; 作为开发服务器的主机 IP。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="示例配置"&gt;示例配置&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;更新 Tauri 配置&lt;/p&gt;</description></item><item><title>7 Next.js</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/7-nextjs/</link><pubDate>Fri, 25 Sep 2026 21:31:08 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/7-nextjs/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://tauri.app/start/frontend/nextjs/"&gt;https://tauri.app/start/frontend/nextjs/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Next.js 是 React 的元框架。你可以在 &lt;a href="https://nextjs.org"&gt;https://nextjs.org&lt;/a&gt; 进一步了解 Next.js。本指南基于 Next.js 14.2.3。&lt;/p&gt;
&lt;h2 id="检查清单"&gt;检查清单&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;通过设置 &lt;code&gt;output: 'export'&lt;/code&gt; 使用静态导出。Tauri 不支持基于服务器的方案。&lt;/li&gt;
&lt;li&gt;在 &lt;code&gt;tauri.conf.json&lt;/code&gt; 中使用 &lt;code&gt;out&lt;/code&gt; 目录作为 &lt;code&gt;frontendDist&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="示例配置"&gt;示例配置&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;更新 Tauri 配置&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;包管理器&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>8 Nuxt</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/8-nuxt/</link><pubDate>Fri, 25 Sep 2026 21:31:08 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/8-nuxt/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://tauri.app/start/frontend/nuxt/"&gt;https://tauri.app/start/frontend/nuxt/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Nuxt 是 Vue 的元框架。你可以在 &lt;a href="https://nuxt.com"&gt;https://nuxt.com&lt;/a&gt; 进一步了解 Nuxt。本指南基于 Nuxt 4.2。&lt;/p&gt;
&lt;h2 id="检查清单"&gt;检查清单&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;通过设置 &lt;code&gt;ssr: false&lt;/code&gt; 使用 SSG。Tauri 不支持基于服务器的方案。&lt;/li&gt;
&lt;li&gt;在 &lt;code&gt;tauri.conf.json&lt;/code&gt; 中使用默认的 &lt;code&gt;../dist&lt;/code&gt; 作为 &lt;code&gt;frontendDist&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;使用 &lt;code&gt;nuxi build&lt;/code&gt; 编译。&lt;/li&gt;
&lt;li&gt;（可选）：在 &lt;code&gt;nuxt.config.ts&lt;/code&gt; 中设置 &lt;code&gt;telemetry: false&lt;/code&gt; 以禁用遥测。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="示例配置"&gt;示例配置&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;更新 Tauri 配置&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;包管理器&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>9 Qwik</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/9-qwik/</link><pubDate>Fri, 25 Sep 2026 21:31:08 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/9-qwik/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://tauri.app/start/frontend/qwik/"&gt;https://tauri.app/start/frontend/qwik/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;本指南将带你使用 Qwik Web 框架创建 Tauri 应用。你可以在 &lt;a href="https://qwik.dev"&gt;https://qwik.dev&lt;/a&gt; 进一步了解 Qwik。&lt;/p&gt;
&lt;h2 id="检查清单"&gt;检查清单&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;使用 &lt;a href="https://qwik.dev/docs/guides/static-site-generation/"&gt;SSG&lt;/a&gt;。Tauri 不支持基于服务器的方案。&lt;/li&gt;
&lt;li&gt;在 &lt;code&gt;tauri.conf.json&lt;/code&gt; 中使用 &lt;code&gt;dist/&lt;/code&gt; 作为 &lt;code&gt;frontendDist&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="示例配置"&gt;示例配置&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;创建一个新的 Qwik 应用&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;包管理器&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>10 SvelteKit</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/10-sveltekit/</link><pubDate>Fri, 25 Sep 2026 21:31:08 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/10-sveltekit/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://tauri.app/start/frontend/sveltekit/"&gt;https://tauri.app/start/frontend/sveltekit/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;SvelteKit 是 Svelte 的元框架。你可以在 &lt;a href="https://svelte.dev/"&gt;https://svelte.dev/&lt;/a&gt; 进一步了解 SvelteKit。本指南基于 SvelteKit 2.20.4 / Svelte 5.25.8。&lt;/p&gt;
&lt;h2 id="检查清单"&gt;检查清单&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;通过 &lt;code&gt;static-adapter&lt;/code&gt; 使用 &lt;a href="https://svelte.dev/docs/kit/adapter-static"&gt;SSG&lt;/a&gt; 和 &lt;a href="https://svelte.dev/docs/kit/single-page-apps"&gt;SPA&lt;/a&gt;。Tauri 不支持基于服务器的方案。&lt;/li&gt;
&lt;li&gt;如果使用&lt;strong&gt;带预渲染&lt;/strong&gt;的 SSG，请注意在应用的构建过程中 &lt;code&gt;load&lt;/code&gt; 函数无法访问 tauri API。推荐使用 SPA 模式（不带预渲染），这样 &lt;code&gt;load&lt;/code&gt; 函数只会在 webview 中运行，并能访问 tauri API。&lt;/li&gt;
&lt;li&gt;在 &lt;code&gt;tauri.conf.json&lt;/code&gt; 中使用 &lt;code&gt;build/&lt;/code&gt; 作为 &lt;code&gt;frontendDist&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="示例配置"&gt;示例配置&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;安装 &lt;code&gt;@sveltejs/adapter-static&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;包管理器&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>11 Leptos</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/11-leptos/</link><pubDate>Fri, 25 Sep 2026 21:31:08 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/11-leptos/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://tauri.app/start/frontend/leptos/"&gt;https://tauri.app/start/frontend/leptos/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Leptos 是一个基于 Rust 的 Web 框架。你可以在其&lt;a href="https://leptos.dev/"&gt;官方网站&lt;/a&gt;进一步了解 Leptos。本指南基于 Leptos 0.6 版本。&lt;/p&gt;
&lt;h2 id="检查清单"&gt;检查清单&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;使用 SSG，Tauri 官方不支持基于服务器的方案。&lt;/li&gt;
&lt;li&gt;设置 &lt;code&gt;serve.ws_protocol = &amp;quot;ws&amp;quot;&lt;/code&gt;，以便移动端开发时热重载 WebSocket 能正常连接。&lt;/li&gt;
&lt;li&gt;启用 &lt;code&gt;withGlobalTauri&lt;/code&gt;，确保 Tauri API 可通过 &lt;code&gt;window.__TAURI__&lt;/code&gt; 变量使用，并可用 &lt;code&gt;wasm-bindgen&lt;/code&gt; 导入。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="示例配置"&gt;示例配置&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;更新 Tauri 配置&lt;/p&gt;</description></item><item><title>12 Trunk</title><link>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/12-trunk/</link><pubDate>Fri, 25 Sep 2026 21:31:08 +0800</pubDate><guid>https://before80.github.io/prgms/Rust/tauriBasic/start/quickstart/frontend-configuration/12-trunk/</guid><description>&lt;blockquote&gt;
&lt;p&gt;原文链接: &lt;a href="https://tauri.app/start/frontend/trunk/"&gt;https://tauri.app/start/frontend/trunk/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Trunk 是 Rust 的 WASM Web 应用打包工具。你可以在 &lt;a href="https://trunk-rs.github.io/trunk/"&gt;https://trunk-rs.github.io/trunk/&lt;/a&gt; 进一步了解 Trunk。本指南基于 Trunk 0.17.5。&lt;/p&gt;
&lt;h2 id="检查清单"&gt;检查清单&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;使用 SSG，Tauri 官方不支持基于服务器的方案。&lt;/li&gt;
&lt;li&gt;设置 &lt;code&gt;serve.ws_protocol = &amp;quot;ws&amp;quot;&lt;/code&gt;，以便移动端开发时热重载 WebSocket 能正常连接。&lt;/li&gt;
&lt;li&gt;启用 &lt;code&gt;withGlobalTauri&lt;/code&gt;，确保 Tauri API 可通过 &lt;code&gt;window.__TAURI__&lt;/code&gt; 变量使用，并可用 &lt;code&gt;wasm-bindgen&lt;/code&gt; 导入。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="示例配置"&gt;示例配置&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;更新 Tauri 配置&lt;/p&gt;</description></item></channel></rss>