fix(tauri): require standalone server in desktop bundles
This commit is contained in:
@@ -87,10 +87,6 @@ function ensureStandaloneServerBuild() {
|
||||
})
|
||||
}
|
||||
|
||||
function shouldBuildStandaloneServer() {
|
||||
return process.platform !== "linux"
|
||||
}
|
||||
|
||||
function ensureUiBuild() {
|
||||
const loadingHtml = path.join(uiDist, "loading.html")
|
||||
if (fs.existsSync(loadingHtml)) {
|
||||
@@ -146,17 +142,6 @@ function ensureServerDependencies() {
|
||||
}
|
||||
}
|
||||
|
||||
function removeStaleStandaloneServerBuild() {
|
||||
const staleNames = ["codenomad-server", "codenomad-server.exe"]
|
||||
for (const name of staleNames) {
|
||||
const stalePath = path.join(serverRoot, "dist", name)
|
||||
if (fs.existsSync(stalePath)) {
|
||||
fs.rmSync(stalePath, { force: true })
|
||||
console.log(`[prebuild] removed stale standalone server artifact ${stalePath}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ensureUiDevDependencies() {
|
||||
if (fs.existsSync(viteBinPath)) {
|
||||
return
|
||||
@@ -328,12 +313,7 @@ function copyUiLoadingAssets() {
|
||||
ensureRollupPlatformBinary()
|
||||
ensureEsbuildPlatformBinary()
|
||||
ensureServerBuild()
|
||||
if (shouldBuildStandaloneServer()) {
|
||||
ensureStandaloneServerBuild()
|
||||
} else {
|
||||
removeStaleStandaloneServerBuild()
|
||||
console.log("[prebuild] skipping standalone server executable for Linux packaging; linuxdeploy fails on the bundled ELF")
|
||||
}
|
||||
ensureStandaloneServerBuild()
|
||||
ensureServerDependencies()
|
||||
ensureUiBuild()
|
||||
syncServerUiBundle()
|
||||
|
||||
Reference in New Issue
Block a user