bingocode 1.1.61 → 1.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -175,13 +175,18 @@
|
|
|
175
175
|
|
|
176
176
|
const spawnArgs = [opts.serverEntry, '--host', host, '--port', String(port)];
|
|
177
177
|
const spawnEnv = { ...process.env, SERVER_AUTH_REQUIRED: '0', ...(opts.passEnv || {}) };
|
|
178
|
+
// cwd 设为包根目录(serverEntry 的两级上级:src/server -> src -> 包根),
|
|
179
|
+
// 确保 bun 能从正确位置查找 node_modules,无论用户在哪个目录启动
|
|
180
|
+
const serverCwd = path.dirname(path.dirname(path.dirname(opts.serverEntry)));
|
|
178
181
|
log(`spawn: ${bun} ${spawnArgs.join(' ')}`);
|
|
182
|
+
log(`spawn cwd: ${serverCwd}`);
|
|
179
183
|
|
|
180
184
|
child = spawn(
|
|
181
185
|
bun,
|
|
182
186
|
spawnArgs,
|
|
183
187
|
{
|
|
184
188
|
env: spawnEnv,
|
|
189
|
+
cwd: serverCwd,
|
|
185
190
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
186
191
|
detached: false,
|
|
187
192
|
}
|