feat: added webpack, stimulus and turbo

This commit is contained in:
Stephan Plöhn 2025-08-26 11:59:30 +02:00
parent f3b60adb21
commit 93939ff054
8 changed files with 62 additions and 10 deletions

View file

@ -57,7 +57,8 @@ return [
escapeshellarg($router)
);
$npmCmd = 'npm run watch';
$cssCmd = 'npm run watch:css';
$jsCmd = 'npm run watch:js';
$cli->info("Starting PHP dev server on http://{$host}:{$port} (docroot: {$docroot})");
@ -95,11 +96,18 @@ return [
}
$processes['php'] = $phpProc;
$npmProc = $start($npmCmd);
$npmProc = $start($cssCmd);
if ($npmProc === null) {
$cli->warning('Could not start npm watcher. Is Node/npm installed and in your PATH?');
} else {
$processes['npm'] = $npmProc;
$processes['css'] = $npmProc;
}
$jsProc = $start($jsCmd);
if ($jsProc === null) {
$cli->warning('Could not start npm watcher. Is Node/npm installed and in your PATH?');
} else {
$processes['js'] = $jsProc;
}
// Graceful termination
@ -150,8 +158,9 @@ return [
// Stream outputs until all children exit
$prefixColor = [
'php' => fn($s) => "\033[1;34m🐘 [php]\033[0m $s",
'npm' => fn($s) => "\033[1;32m [npm]\033[0m $s",
'php' => fn($s) => "\033[1;34m [php]\033[0m $s",
'css' => fn($s) => "\033[1;32m󱏿 [css]\033[0m $s",
'js' => fn($s) => "\033[1;97m [js]\033[0m $s",
];
while (true) {