Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Asset/EntrypointLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ private function getEntriesData(): array
}
}

if (!file_exists($this->entrypointJsonPath)) {
$entrypointJsonContents = file_get_contents($this->entrypointJsonPath);
if ($entrypointJsonContents === false) {
if (!$this->strictMode) {
return [];
}
throw new \InvalidArgumentException(sprintf('Could not find the entrypoints file from Webpack: the file "%s" does not exist.', $this->entrypointJsonPath));
throw new \InvalidArgumentException(sprintf('Could not find the entrypoints file from Webpack: the file "%s" does not exist or it is not readable.', $this->entrypointJsonPath));
}

$this->entriesData = json_decode(file_get_contents($this->entrypointJsonPath), true);
$this->entriesData = json_decode($entrypointJsonContents, true);

if (null === $this->entriesData) {
throw new \InvalidArgumentException(sprintf('There was a problem JSON decoding the "%s" file', $this->entrypointJsonPath));
Expand Down