diff --git a/src/Encore.php b/src/Encore.php index b2243d4..a65f1b0 100644 --- a/src/Encore.php +++ b/src/Encore.php @@ -136,7 +136,12 @@ public function getAssets(string $name, string $entryPoint, array $config): arra $entrypoints = $this->getEntrypoint($name); if (!isset($entrypoints['entrypoints'][$entryPoint])) { - throw new \LogicException('No entry point found in the entrypoint.js'); + throw new \LogicException( + 'EntryPoint: ' . $entryPoint . ' not found in entrypoint.json. ' . \PHP_EOL . + 'Available entry points are: ' . implode(', ', array_keys( + $entrypoints['entrypoints'] + )) + ); } $enqueue = $entrypoints['entrypoints'][$entryPoint]; @@ -222,7 +227,7 @@ public function getEntrypoint(string $dir): array return $this->entryPointCache[$this->outputPath][$dir]; } - $filepath = $this->rootPath . '/entrypoints.json'; + $filepath = trailingslashit($this->rootPath) . 'entrypoints.json'; if (!file_exists($filepath)) { throw new \LogicException(sprintf('Entrypoint %s does not exist.', $filepath));