This commit is contained in:
nuno maduro
2026-05-01 22:55:38 +01:00
parent e59b99cd73
commit 21efbc3107
4 changed files with 79 additions and 30 deletions

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Pest\Plugins\Tia;
use Pest\Support\Cpu;
use Symfony\Component\Process\ExecutableFinder;
use Symfony\Component\Process\Process;
@ -166,7 +167,7 @@ final class JsModuleGraph
return null;
}
$env = [];
$env = ['TIA_VITE_CONCURRENCY' => (string) max(4, min(32, Cpu::cores() * 2))];
foreach (['resources/js/Pages', 'resources/js/pages'] as $candidate) {
if (is_dir($projectRoot.DIRECTORY_SEPARATOR.$candidate)) {
$env['TIA_VITE_PAGES_DIR'] = $candidate;

18
src/Support/Cpu.php Normal file
View File

@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace Pest\Support;
use Fidry\CpuCoreCounter\CpuCoreCounter;
/**
* @internal
*/
final class Cpu
{
public static function cores(int $fallback = 4): int
{
return (new CpuCoreCounter)->getCountWithFallback($fallback);
}
}