修正启动模式

This commit is contained in:
2025-09-19 00:21:05 +08:00
parent c4073618e4
commit e3273d29c7
2 changed files with 50 additions and 2 deletions

View File

@@ -38,8 +38,8 @@ if (!fs.existsSync(distDir)) {
}
}
// 使用node启动服务器
const server = spawn('node', [serverPath], {
// 使用start:node server.js启动服务器
const server = spawn('node', ['server/index.js'], {
cwd: rootDir,
env: {
...process.env,
@@ -49,6 +49,8 @@ const server = spawn('node', [serverPath], {
stdio: ['ignore', 'pipe', 'pipe']
});
console.log('使用启动命令: start:node server.js');
// 将输出写入日志
server.stdout.pipe(logStream);
server.stderr.pipe(logStream);