Skip to content

Commit

Permalink
Fix entrypoints prefix with preload option
Browse files Browse the repository at this point in the history
  • Loading branch information
ElGigi committed Dec 4, 2024
1 parent e94b36c commit e55a2a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. This projec
to [Semantic Versioning] (http://semver.org/). For change log format,
use [Keep a Changelog] (http://keepachangelog.com/).

## [2.3.1] - 2024-12-04

### Fixed

- Entrypoints prefix with preload option

## [2.3.0] - 2024-12-04

### Added
Expand Down
8 changes: 6 additions & 2 deletions src/Extension/AssetRuntimeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,16 @@ public function entryPoints(
array_merge(['as' => 'script'], $preloadOptions)
);
unset($options['preload']);
} else {
$entryPoint = $this->getRouter()->finalizePath($entryPoint);
}

$output .= sprintf(
'<script%s></script>',
$this->attributes(
array_replace(
$options,
['src' => $this->getRouter()->finalizePath($entryPoint)]
['src' => $entryPoint]
)
),
) . PHP_EOL;
Expand All @@ -142,6 +144,8 @@ public function entryPoints(
array_merge(['as' => 'style'], $preloadOptions)
);
unset($options['preload']);
} else {
$entryPoint = $this->getRouter()->finalizePath($entryPoint);
}

$output .= sprintf(
Expand All @@ -151,7 +155,7 @@ public function entryPoints(
$options,
[
'rel' => 'stylesheet',
'href' => $this->getRouter()->finalizePath($entryPoint)
'href' => $entryPoint,
]
)
),
Expand Down

0 comments on commit e55a2a2

Please sign in to comment.