mirror of
https://github.com/pestphp/pest.git
synced 2026-06-05 10:52:14 +02:00
wip
This commit is contained in:
@ -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
18
src/Support/Cpu.php
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user