castle-web-cli 0.4.8 → 0.4.9
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.
- package/dist/serve.js +4 -1
- package/package.json +1 -1
package/dist/serve.js
CHANGED
|
@@ -210,9 +210,12 @@ async function serveDetached(projectDir, options) {
|
|
|
210
210
|
args.push('--host', options.host);
|
|
211
211
|
if (options.open)
|
|
212
212
|
args.push('--open');
|
|
213
|
+
// We stay in the parent's process group (no detached: true) so that when
|
|
214
|
+
// the agent / shell that invoked `castle-web init` exits, SIGHUP reaches
|
|
215
|
+
// this serve and it dies with the session. The `.unref()` is what lets
|
|
216
|
+
// the calling node process exit while the serve keeps running until then.
|
|
213
217
|
const child = spawn(process.execPath, [entry, ...args], {
|
|
214
218
|
cwd: projectDir,
|
|
215
|
-
detached: true,
|
|
216
219
|
stdio: ['ignore', logFd, logFd],
|
|
217
220
|
env: process.env,
|
|
218
221
|
});
|