feat: added webpack, stimulus and turbo
This commit is contained in:
parent
f3b60adb21
commit
93939ff054
8 changed files with 62 additions and 10 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue