build(tauri): 更改打包配置

This commit is contained in:
BTMuli
2023-03-30 14:20:20 +08:00
parent cee575ad6b
commit 3953b98a48
4 changed files with 38 additions and 8 deletions

21
src-tauri/Cargo.lock generated
View File

@@ -1404,6 +1404,12 @@ dependencies = [
"autocfg", "autocfg",
] ]
[[package]]
name = "minisign-verify"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881"
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.6.2" version = "0.6.2"
@@ -2617,6 +2623,7 @@ checksum = "fe7e0f1d535e7cbbbab43c82be4fc992b84f9156c16c160955617e0260ebc449"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"attohttpc", "attohttpc",
"base64 0.13.1",
"cocoa", "cocoa",
"dirs-next", "dirs-next",
"embed_plist", "embed_plist",
@@ -2629,6 +2636,7 @@ dependencies = [
"heck 0.4.1", "heck 0.4.1",
"http", "http",
"ignore", "ignore",
"minisign-verify",
"notify-rust", "notify-rust",
"objc", "objc",
"once_cell", "once_cell",
@@ -2654,12 +2662,14 @@ dependencies = [
"tauri-utils", "tauri-utils",
"tempfile", "tempfile",
"thiserror", "thiserror",
"time",
"tokio", "tokio",
"url", "url",
"uuid 1.3.0", "uuid 1.3.0",
"webkit2gtk", "webkit2gtk",
"webview2-com", "webview2-com",
"windows 0.39.0", "windows 0.39.0",
"zip",
] ]
[[package]] [[package]]
@@ -3625,3 +3635,14 @@ checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc"
dependencies = [ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "zip"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0445d0fbc924bb93539b4316c11afb121ea39296f99a3c4c9edad09e3658cdef"
dependencies = [
"byteorder",
"crc32fast",
"crossbeam-utils",
]

View File

@@ -13,7 +13,7 @@ edition = "2021"
tauri-build = { version = "1.2", features = [] } tauri-build = { version = "1.2", features = [] }
[dependencies] [dependencies]
tauri = { version = "1.2", features = ["api-all"] } tauri = { version = "1.2", features = ["api-all", "updater"] }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"

View File

@@ -2,7 +2,7 @@
"build": { "build": {
"beforeDevCommand": "npm run dev", "beforeDevCommand": "npm run dev",
"beforeBuildCommand": "npm run build", "beforeBuildCommand": "npm run build",
"devPath": "http://localhost:1420", "devPath": "http://localhost:3000",
"distDir": "../dist", "distDir": "../dist",
"withGlobalTauri": true "withGlobalTauri": true
}, },
@@ -20,7 +20,11 @@
"http": { "http": {
"all": true, "all": true,
"request": true, "request": true,
"scope": ["https://**", "http://**"] "scope": [
"https://api-takumi.mihoyo.com/*",
"https://bbs-api.mihoyo.com/*",
"https://bbs.mihoyo.com/*"
]
}, },
"shell": { "shell": {
"all": false, "all": false,
@@ -42,15 +46,20 @@
"csp": null "csp": null
}, },
"updater": { "updater": {
"active": false "active": true,
"dialog": true,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEU5OEE2RkU0QUZCMTMzMUEKUldRYU03R3Y1RytLNlI4bytTRDhpYTNTL2lTOUVZeWQwOTAxNHBock8zY3FrdVliR2kvdHhoN2IK"
}, },
"windows": [ "windows": [
{ {
"fullscreen": false, "fullscreen": false,
"resizable": true, "resizable": true,
"title": "tauri-genshin", "title": "Tauri.Genshin v0.0.0-alpha",
"width": 1540, "label": "tauri-genshin",
"height": 912 "width": 1600,
"height": 900,
"center": true,
"transparent": true
} }
] ]
} }

View File

@@ -12,7 +12,7 @@ export default defineConfig({
clearScreen: false, clearScreen: false,
// tauri expects a fixed port, fail if that port is not available // tauri expects a fixed port, fail if that port is not available
server: { server: {
port: 1420, port: 3000,
strictPort: true, strictPort: true,
}, },
// to make use of `TAURI_DEBUG` and other env variables // to make use of `TAURI_DEBUG` and other env variables