fix(tauri): prune Bun from Linux app bundle
This commit is contained in:
@@ -131,15 +131,30 @@ function ensureServerDevDependencies() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ensureServerDependencies() {
|
function ensureServerDependencies() {
|
||||||
if (fs.existsSync(braceExpansionPath)) {
|
console.log("[prebuild] pruning server to production dependencies...")
|
||||||
return
|
execSync("npm prune --omit=dev --ignore-scripts --workspaces=false --fund=false --audit=false", {
|
||||||
}
|
cwd: serverRoot,
|
||||||
|
stdio: "inherit",
|
||||||
|
})
|
||||||
|
|
||||||
console.log("[prebuild] ensuring server production dependencies...")
|
if (!fs.existsSync(braceExpansionPath)) {
|
||||||
|
console.log("[prebuild] restoring missing server production dependencies...")
|
||||||
execSync(serverInstallCommand, {
|
execSync(serverInstallCommand, {
|
||||||
cwd: serverRoot,
|
cwd: serverRoot,
|
||||||
stdio: "inherit",
|
stdio: "inherit",
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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() {
|
function ensureUiDevDependencies() {
|
||||||
@@ -349,13 +364,14 @@ function copyUiLoadingAssets() {
|
|||||||
await ensureMonacoAssets()
|
await ensureMonacoAssets()
|
||||||
ensureRollupPlatformBinary()
|
ensureRollupPlatformBinary()
|
||||||
ensureEsbuildPlatformBinary()
|
ensureEsbuildPlatformBinary()
|
||||||
ensureServerDependencies()
|
|
||||||
ensureServerBuild()
|
ensureServerBuild()
|
||||||
if (shouldBuildStandaloneServer()) {
|
if (shouldBuildStandaloneServer()) {
|
||||||
ensureStandaloneServerBuild()
|
ensureStandaloneServerBuild()
|
||||||
} else {
|
} else {
|
||||||
|
removeStaleStandaloneServerBuild()
|
||||||
console.log("[prebuild] skipping standalone server executable for Linux packaging; linuxdeploy fails on the bundled ELF")
|
console.log("[prebuild] skipping standalone server executable for Linux packaging; linuxdeploy fails on the bundled ELF")
|
||||||
}
|
}
|
||||||
|
ensureServerDependencies()
|
||||||
ensureUiBuild()
|
ensureUiBuild()
|
||||||
syncServerUiBundle()
|
syncServerUiBundle()
|
||||||
copyServerArtifacts()
|
copyServerArtifacts()
|
||||||
|
|||||||
Reference in New Issue
Block a user