Skip to content

Commit 2fe9a88

Browse files
Raphaël LouvradouxKocal
authored andcommitted
Allow entrypoints.json to be hosted remotely
1 parent f5c3db0 commit 2fe9a88

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Asset/EntrypointLookup.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,15 @@ private function getEntriesData(): array
119119
}
120120
}
121121

122-
if (!file_exists($this->entrypointJsonPath)) {
122+
$entrypointJsonContents = file_get_contents($this->entrypointJsonPath);
123+
if ($entrypointJsonContents === false) {
123124
if (!$this->strictMode) {
124125
return [];
125126
}
126-
throw new \InvalidArgumentException(\sprintf('Could not find the entrypoints file from Webpack: the file "%s" does not exist.', $this->entrypointJsonPath));
127+
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));
127128
}
128129

129-
$this->entriesData = json_decode(file_get_contents($this->entrypointJsonPath), true);
130+
$this->entriesData = json_decode($entrypointJsonContents, true);
130131

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

0 commit comments

Comments
 (0)