Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Classes/AssetIncludesBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private function recurseImportedChunkFiles(array &$includes, array $manifestJson
foreach ($imports as $import) {
$manifestEntry = $manifestJson[$import];
if (isset($manifestEntry['file'])) {
$includes[] = '<script type="modulepreload" src="' . htmlspecialchars($this->buildPublicResourceUrl($manifestEntry['file']), ENT_QUOTES, 'UTF-8') . '"></script>';
$includes[] = '<link rel="modulepreload" href="' . htmlspecialchars($this->buildPublicResourceUrl($manifestEntry['file']), ENT_QUOTES, 'UTF-8') . '">';
}
if (isset($manifestEntry['imports'])) {
$this->recurseImportedChunkFiles($includes, $manifestJson, $manifestEntry['imports']);
Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/AssetIncludesBuilderFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function productionIncludes()
'<link rel="stylesheet" href="http://localhost/_Resources/Testing/Static/Packages/Networkteam.Neos.Vite/Dist/assets/main.b82dbe22.css">' . PHP_EOL .
'<link rel="stylesheet" href="http://localhost/_Resources/Testing/Static/Packages/Networkteam.Neos.Vite/Dist/assets/shared.a834bfc3.css">' . PHP_EOL .
'<script type="module" src="http://localhost/_Resources/Testing/Static/Packages/Networkteam.Neos.Vite/Dist/assets/main.4889e940.js"></script>' . PHP_EOL .
'<script type="modulepreload" src="http://localhost/_Resources/Testing/Static/Packages/Networkteam.Neos.Vite/Dist/assets/shared.83069a53.js"></script>'
'<link rel="modulepreload" href="http://localhost/_Resources/Testing/Static/Packages/Networkteam.Neos.Vite/Dist/assets/shared.83069a53.js">'
, $html, 'should create correct includes for main entry');

$file = $builder->productionUrl('main.js');
Expand All @@ -59,7 +59,7 @@ public function productionIncludes()
$this->assertEquals(
'<link rel="stylesheet" href="http://localhost/_Resources/Testing/Static/Packages/Networkteam.Neos.Vite/Dist/assets/shared.a834bfc3.css">' . PHP_EOL .
'<script type="module" src="http://localhost/_Resources/Testing/Static/Packages/Networkteam.Neos.Vite/Dist/assets/foo.869aea0d.js"></script>' . PHP_EOL .
'<script type="modulepreload" src="http://localhost/_Resources/Testing/Static/Packages/Networkteam.Neos.Vite/Dist/assets/shared.83069a53.js"></script>'
'<link rel="modulepreload" href="http://localhost/_Resources/Testing/Static/Packages/Networkteam.Neos.Vite/Dist/assets/shared.83069a53.js">'
, $html, 'should create correct includes for other entries');

$file = $builder->productionUrl('views/foo.js');
Expand Down