refactor: compile backend with tsc, Electron runs dist/index.js

This commit is contained in:
zlm committed 2026-06-10 15:43:23 +08:00
1 parent a31c047091
commit 302472d881
2 files changed
+4 -3

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ const http = require('http')
const path = require('path')
const PROJECT_DIR = path.resolve(__dirname, '../../project')
const TSX = path.join(PROJECT_DIR, 'node_modules', 'tsx', 'dist', 'cli.mjs')
const ENTRY = path.join(PROJECT_DIR, 'dist', 'index.js')
let backend = null
let tray = null
let isRunning = false
@@ -27,7 +27,7 @@ function updateMenu() {
function startBackend() {
if (backend) return
backend = spawn('node', [TSX, 'src/index.ts'], {
backend = spawn('node', [ENTRY], {
cwd: PROJECT_DIR,
stdio: 'ignore',
env: { ...process.env, PORT: process.env.PORT || '3000' },
+2 -1
View File
@@ -4,7 +4,8 @@
"private": true,
"type": "module",
"scripts": {
"dev": "tsx watch src/index.ts",
"dev": "tsx src/index.ts",
"watch": "tsx watch src/index.ts",
"start": "tsx src/index.ts",
"build": "tsc",
"build:web": "cd web && npm run build",