Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,14 @@ function startNodeServer(
const path = join(outputPath, 'main.js');
const env = { ...process.env, PORT: '' + port, NG_ALLOWED_HOSTS: host ?? 'localhost' };

const args = ['--enable-source-maps', `"${path}"`];
const args = ['--enable-source-maps', path];
if (inspectMode) {
args.unshift('--inspect-brk');
}

return of(null).pipe(
delay(0), // Avoid EADDRINUSE error since it will cause the kill event to be finish.
switchMap(() => spawnAsObservable('node', args, { env, shell: true })),
switchMap(() => spawnAsObservable('node', args, { env })),
tap((res) => log({ stderr: res.stderr, stdout: res.stdout }, logger)),
ignoreElements(),
// Emit a signal after the process has been started
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function spawnAsObservable(
options: SpawnOptions = {},
): Observable<{ stdout?: string; stderr?: string }> {
return new Observable((obs) => {
const proc = spawn(`${command} ${args.join(' ')}`, options);
const proc = spawn(command, args, options);
if (proc.stdout) {
proc.stdout.on('data', (data) => obs.next({ stdout: data.toString() }));
}
Expand Down
Loading