refactor(desktop): 优化 Electrobun 构建配置

- 从 package.json 动态读取版本号替代硬编码
- 启用所有平台的 CEF 捆绑
- 将构建目标从配置文件移至 CLI 参数
- 启用 asar 打包并为 dev 脚本添加 --env=dev 标志
This commit is contained in:
2026-02-08 02:38:37 +08:00
parent 7450c685d3
commit b8d38872ad
2 changed files with 7 additions and 6 deletions

View File

@@ -1,27 +1,28 @@
import type { ElectrobunConfig } from 'electrobun'
import { version } from './package.json'
export default {
app: {
name: 'Desktop',
identifier: 'com.furtherverse.desktop',
version: '1.0.0',
version,
},
build: {
useAsar: true,
bun: {
entrypoint: 'src/bun/index.ts',
},
copy: {
'../server/.output': 'server-output',
},
targets: 'win-x64',
linux: {
bundleCEF: true,
},
mac: {
bundleCEF: false,
bundleCEF: true,
},
win: {
bundleCEF: false,
bundleCEF: true,
},
},
} satisfies ElectrobunConfig