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
thrownew \LogicException(sprintf('The contents of package "%s" were not downloaded.', $resolvedPackage->requireOptions->packageName));
@@ -349,18 +349,13 @@ private function loadImportMapEntries(): array
349
349
thrownew \InvalidArgumentException(sprintf('The following keys are not valid for the importmap entry "%s": "%s". Valid keys are: "%s".', $importName, implode('", "', $invalidKeys), implode('", "', $validKeys)));
350
350
}
351
351
352
-
$type = $data['type'] ?? ImportMapEntry::TYPE_JS;
353
-
if (!\in_array($type, ImportMapEntry::getValidTypes(), true)) {
354
-
thrownew \InvalidArgumentException(sprintf('The "type" for import "%s" must be one of "%s", "%s" given.', $importName, implode(', ', ImportMapEntry::getValidTypes()), $type));
@@ -397,8 +392,8 @@ private function writeImportMapConfig(array $entries): void
397
392
if ($entry->preload) {
398
393
$config['preload'] = $entry->preload;
399
394
}
400
-
if (ImportMapEntry::TYPE_JS !== $entry->type) {
401
-
$config['type'] = $entry->type;
395
+
if (ImportMapType::JS !== $entry->type) {
396
+
$config['type'] = $entry->type->value;
402
397
}
403
398
$importMapConfig[$entry->importName] = $config;
404
399
}
@@ -462,7 +457,7 @@ private function convertEntriesToImports(array $entries, bool $isTopLevel): arra
462
457
thrownew \InvalidArgumentException(sprintf('The package "%s" mentioned in "%s" must have a "path" or "url" key.', $entryOptions->importName, basename($this->importMapConfigPath)));
463
458
}
464
459
465
-
if (ImportMapEntry::TYPE_CSS === $entryOptions->type) {
460
+
if (ImportMapType::CSS === $entryOptions->type) {
466
461
if ($entryOptions->preload) {
467
462
// importmap is a noop because this will be rendered as a link tag
468
463
$this->linkTags[] = $path;
@@ -493,7 +488,7 @@ private function convertEntriesToImports(array $entries, bool $isTopLevel): arra
493
488
$dependency->asset->logicalPath,
494
489
// if parent is preload & dependency is not lazy, then preload
0 commit comments