diff --git a/Classes/Eel/Helper/IncludeAssetsHelper.php b/Classes/Eel/Helper/IncludeAssetsHelper.php index 813eaf6..a837404 100644 --- a/Classes/Eel/Helper/IncludeAssetsHelper.php +++ b/Classes/Eel/Helper/IncludeAssetsHelper.php @@ -99,16 +99,9 @@ public function parseFilename(string $string): ?array } } - // Add type to javascript or modules - if (strpos($object['attributes'], ' type=') === false) { - switch ($object['type']) { - case 'js': - $object['attributes'] .= ' type="text/javascript"'; - break; - case 'mjs': - $object['attributes'] .= ' type="module"'; - break; - } + // Add type to javascript modules + if ($object['type'] === 'mjs' && strpos($object['attributes'], ' type=') === false) { + $object['attributes'] .= ' type="module"'; } // Add as="type" to preload CSS and JS