9 Qwik
原文链接: https://tauri.app/start/frontend/qwik/
本指南将带你使用 Qwik Web 框架创建 Tauri 应用。你可以在 https://qwik.dev 进一步了解 Qwik。
检查清单
- 使用 SSG。Tauri 不支持基于服务器的方案。
- 在
tauri.conf.json 中使用 dist/ 作为 frontendDist。
示例配置
- 创建一个新的 Qwik 应用
包管理器
1
2
| npm create qwik@latest
cd <PROJECT>
|
1
2
| yarn create qwik@latest
cd <PROJECT>
|
1
2
| pnpm create qwik@latest
cd <PROJECT>
|
1
2
| deno run -A npm:create-qwik@latest
cd <PROJECT>
|
2. 安装
static adapter包管理器
1
| npm run qwik add static
|
1
| deno task qwik add static
|
3. 把 Tauri CLI 添加到你的项目
包管理器
1
| npm install -D @tauri-apps/cli@latest
|
1
| yarn add -D @tauri-apps/cli@latest
|
1
| pnpm add -D @tauri-apps/cli@latest
|
1
| deno add -D npm:@tauri-apps/cli@latest
|
4. 初始化一个新的 Tauri 项目
包管理器
5. Tauri 配置
包管理器
1
2
3
4
5
6
7
8
9
| // tauri.conf.json
{
"build": {
"devUrl": "http://localhost:5173"
"frontendDist": "../dist",
"beforeDevCommand": "npm run dev",
"beforeBuildCommand": "npm run build"
}
}
|
1
2
3
4
5
6
7
8
9
| // tauri.conf.json
{
"build": {
"devUrl": "http://localhost:5173"
"frontendDist": "../dist",
"beforeDevCommand": "yarn dev",
"beforeBuildCommand": "yarn build"
}
}
|
1
2
3
4
5
6
7
8
9
| // tauri.conf.json
{
"build": {
"devUrl": "http://localhost:5173"
"frontendDist": "../dist",
"beforeDevCommand": "pnpm dev",
"beforeBuildCommand": "pnpm build"
}
}
|
1
2
3
4
5
6
7
8
9
| // tauri.conf.json
{
"build": {
"devUrl": "http://localhost:5173"
"frontendDist": "../dist",
"beforeDevCommand": "deno task dev",
"beforeBuildCommand": "deno task build"
}
}
|
6. 启动你的
tauri 应用
包管理器