-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
EcmaScript modules require a rel=modulepreload instead of rel=preload: https://web.dev/articles/modulepreload
It would be nice if the extension would reflect that. An simple approach would be to check if the file extension is .mjs. Something like this in Classes/Http/ResourcePusher.php:addPreloadHeaderToResponse():
if(str_contains($uri, '.mjs')) {
return $response->withAddedHeader('Link', '<' . htmlspecialchars(PathUtility::getAbsoluteWebPath($uri)) . '>; rel=modulepreload; as=' . $type);
} else {
return $response->withAddedHeader('Link', '<' . htmlspecialchars(PathUtility::getAbsoluteWebPath($uri)) . '>; rel=preload; as=' . $type);
}Metadata
Metadata
Assignees
Labels
No labels