feat(desktop): self-contained — bundle the frontend
- build:renderer builds Fabric.Frontend with relative base and copies the static bundle into renderer/; dist/pack scripts run it first. - main.js: production loads renderer/index.html when present (falls back to offline.html); packaged app no longer needs a separate frontend server (still talks to Center/Guild backends, which the login screen points at — file:// origin is CORS-allowed). - package files += renderer/**; gitignore renderer/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
6
main.js
6
main.js
@@ -4,7 +4,11 @@ const path = require('path')
|
||||
|
||||
const isDev = !!process.env.FABRIC_DESKTOP_URL
|
||||
const DEFAULT_DEV_URL = 'http://localhost:5173'
|
||||
const DEFAULT_PROD_ENTRY = path.join(__dirname, 'offline.html')
|
||||
// Self-contained: load the bundled frontend if present, else the placeholder.
|
||||
const BUNDLED_ENTRY = path.join(__dirname, 'renderer', 'index.html')
|
||||
const DEFAULT_PROD_ENTRY = fs.existsSync(BUNDLED_ENTRY)
|
||||
? BUNDLED_ENTRY
|
||||
: path.join(__dirname, 'offline.html')
|
||||
|
||||
let mainWindow = null
|
||||
let tray = null
|
||||
|
||||
Reference in New Issue
Block a user