WebpackEncoreBundler::class, self::BUNDLER_VITE => ViteBundler::class, ]; protected ?ManifestReader $manifestReader; public function __construct(?ManifestReader $manifestReader = null) { if (isset($manifestReader)) { $this->manifestReader = $manifestReader; } } public function getBundlerType(): string { return array_flip(self::$bundlers)[get_class($this)]; } public function validateBundlerType(string $bundlerType) { if ($this->getBundlerType() != $bundlerType) { throw new AssetsManifestException( sprintf( 'Expected bundler type is %s, but actual %s', $bundlerType, $this->getBundlerType() ) ); } } public function getEntrypoint(string $entrypointPathInManifest): array { return $this->manifestReader->get($entrypointPathInManifest); } }