按照官方文档,选择自己的平台搭建,这里以mac为例
安装命令行工具
xcode-select --install
安装gcc
brew install gcc
安装配置rust环境
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rust环境配置完成后可以通过查询版本确认安装情况
rustc --version
之前被中科大的镜像给坑了,后面找了很久发现字节跳动的镜像不错
crates.io Mirror
在**~/.cargo/config**中输入以下内容
[source.crates-io]
replace-with = 'rsproxy'
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"
[net]
git-fetch-with-cli = true
Rustup Mirror
在**~/.zshrc or ~/.bashrch**中输入以下内容
export RUSTUP_DIST_SERVER="https://rsproxy.cn"
export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup"
-
克隆模板
git@github.com:Kerinlin/vue-tauri-template.git
-
安装依赖
yarn
-
运行项目
yarn tauri:serve
-
打包项目
yarn tauri:build