Skip to content

Commit

Permalink
Allow entrypoints.json to be hosted remotely
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Louvradoux committed Oct 8, 2020
1 parent 5c0f659 commit 52670b6
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit 52670b6

Please sign in to comment.