Skip to content

Commit

Permalink
💥 Remove default type="text/javascript" for JS files
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Nov 22, 2020
1 parent ade6d34 commit 72a2aca
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Classes/Eel/Helper/IncludeAssetsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 72a2aca

Please sign in to comment.