We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fb1db8c + daab846 commit 5980489Copy full SHA for 5980489
src/Vite.php
@@ -39,8 +39,14 @@ public static function tags(): ?string
39
# Now, we will get all js files and css from the manifest.
40
foreach ($manifest as $file)
41
{
42
- # Js files.
43
- $result .= '<script type="module" src="/' . $file->file . '"></script>';
+ # Check extension
+ $fileExtension = substr($file->file, -3, 3);
44
+
45
+ # Generate js tag.
46
+ if ($fileExtension === '.js' && isset($file->isEntry) && $file->isEntry === true)
47
+ {
48
+ $result .= '<script type="module" src="/' . $file->file . '"></script>';
49
+ }
50
51
if (!empty($file->css))
52
0 commit comments