whackrow
Version:
JS dev kit for game+controls over WebSocket with Vite dev server.
14 lines (9 loc) • 448 B
JavaScript
import { fileURLToPath } from 'node:url'
import path from 'node:path'
import { spawn } from 'node:child_process'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const pkgRoot = path.resolve(__dirname, '..')
const serverEntrypoint = path.join(pkgRoot, 'server', 'ws-server.js')
const child = spawn(process.execPath, [serverEntrypoint], { stdio: 'inherit' })
child.on('exit', (code) => process.exit(code ?? 0))