W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
要使用 GitHub(前沿版本)的 Tauri,您需要更改項目中的 文件,并更新 CLI 和 API。Cargo.toml
將此附加到您的 文件:Cargo.toml
Cargo.toml
[patch.crates-io]
tauri = { git = "https://github.com/tauri-apps/tauri", branch = "dev" }
tauri-build = { git = "https://github.com/tauri-apps/tauri", branch = "dev" }
這將強制所有依賴使用 和 時從 Git 拉取 ,而不是 crates.io。tauri
tauri-build
如果您使用的是 Cargo CLI,則可以直接從 GitHub 安裝它:
cargo install --git https://github.com/tauri-apps/tauri --branch dev tauri-cli
如果使用的是 軟件包,則需要克隆存儲庫并生成它:@tauri-apps/cli
git clone https://github.com/tauri-apps/tauri
git checout dev
cd tauri/tooling/cli/node
yarn
yarn building
要使用它,請直接使用 node 運行:
node /path/to/tauri/tooling/cli/node/tauri.js dev
node /path/to/tauri/tooling/cli/node/tauri.js building
或者,您可以直接使用 Cargo 運行您的應(yīng)用:
cd src-tauri
cargo run --no-default-features # instead of tauri dev
cargo build # instead of tauri build - won't bundle your app though
建議在 GitHub 使用 Tauri crate 時也使用 Tauri API 包(盡管可能不需要)。 若要從源代碼生成它,請運行以下腳本:
git clone https://github.com/tauri-apps/tauri
git checkout dev
cd tauri/tooling/api
yarn
yarn build
現(xiàn)在您可以使用 yarn 鏈接它:
cd dist
yarn link
cd /path/to/your/project
yarn link @tauri-apps/api
或者您可以更改您的 package.json 直接指向dist 文件夾:
package.json
{
"dependencies": {
"@tauri-apps/api": "/path/to/tauri/tooling/api/dist"
}
}
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: