Skip to content

Commit de5e88d

Browse files
smitssjorsreinink
andauthored
Add option for using the bun js runtime in SSR (#552)
* Add option for using the bun js runtime * Tweak wording --------- Co-authored-by: Jonathan Reinink <[email protected]>
1 parent 609f960 commit de5e88d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Commands/StartSsr.php

+10-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class StartSsr extends Command
1414
*
1515
* @var string
1616
*/
17-
protected $name = 'inertia:start-ssr';
17+
protected $signature = 'inertia:start-ssr {--runtime=node : The runtime to use (`node` or `bun`)}';
1818

1919
/**
2020
* The console command description.
@@ -50,9 +50,17 @@ public function handle(): int
5050
$this->warn('Using a default bundle instead: "'.$bundle.'"');
5151
}
5252

53+
$runtime = $this->option('runtime');
54+
55+
if (! in_array($runtime, ['node', 'bun'])) {
56+
$this->error('Unsupported runtime: "'.$runtime.'". Supported runtimes are `node` and `bun`.');
57+
58+
return self::INVALID;
59+
}
60+
5361
$this->callSilently('inertia:stop-ssr');
5462

55-
$process = new Process(['node', $bundle]);
63+
$process = new Process([$runtime, $bundle]);
5664
$process->setTimeout(null);
5765
$process->start();
5866

0 commit comments

Comments
 (0)