You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($invalidKeys = array_diff(array_keys($data), $validKeys)) {
43
43
thrownew \InvalidArgumentException(sprintf('The following keys are not valid for the importmap entry "%s": "%s". Valid keys are: "%s".', $importName, implode('", "', $invalidKeys), implode('", "', $validKeys)));
44
44
}
@@ -47,15 +47,33 @@ public function getEntries(): ImportMapEntries
47
47
$isEntry = $data['entrypoint'] ?? false;
48
48
49
49
if ($isEntry && ImportMapType::JS !== $type) {
50
-
thrownewRuntimeException('The "entrypoint" option can only be used with the "js" type.');
50
+
thrownewRuntimeException(sprintf('The "entrypoint" option can only be used with the "js" type. Found in importmap.php for key "%s"', $importName));
51
+
}
52
+
53
+
$preload = null;
54
+
// render_link_tag is an alias for preload for CSS type
55
+
if (isset($data['render_link_tag'])) {
56
+
if (ImportMapType::CSS !== $type) {
57
+
thrownewRuntimeException(sprintf('The "render_link_tag" option can only be used with the "css" type. Found in importmap.php for key "%s"', $importName));
58
+
}
59
+
60
+
$preload = $data['render_link_tag'];
61
+
}
62
+
63
+
if (isset($data['preload'])) {
64
+
if (ImportMapType::JS !== $type) {
65
+
thrownewRuntimeException(sprintf('The "preload" option can only be used with the "js" type. Found in importmap.php for key "%s"', $importName));
0 commit comments