refactor: compile backend with tsc, Electron runs dist/index.js
This commit is contained in:
1 parent
a31c047091
commit
302472d881
2 files changed
+4
-3
No files matched your search
+2
-2
@@ -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' },
|
||||
|
||||
Reference in new issue
Block a user