diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b9362b..ee4e546 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/Extension/AssetRuntimeExtension.php b/src/Extension/AssetRuntimeExtension.php index 4c6cd73..a84ab9d 100644 --- a/src/Extension/AssetRuntimeExtension.php +++ b/src/Extension/AssetRuntimeExtension.php @@ -123,6 +123,8 @@ public function entryPoints( array_merge(['as' => 'script'], $preloadOptions) ); unset($options['preload']); + } else { + $entryPoint = $this->getRouter()->finalizePath($entryPoint); } $output .= sprintf( @@ -130,7 +132,7 @@ public function entryPoints( $this->attributes( array_replace( $options, - ['src' => $this->getRouter()->finalizePath($entryPoint)] + ['src' => $entryPoint] ) ), ) . PHP_EOL; @@ -142,6 +144,8 @@ public function entryPoints( array_merge(['as' => 'style'], $preloadOptions) ); unset($options['preload']); + } else { + $entryPoint = $this->getRouter()->finalizePath($entryPoint); } $output .= sprintf( @@ -151,7 +155,7 @@ public function entryPoints( $options, [ 'rel' => 'stylesheet', - 'href' => $this->getRouter()->finalizePath($entryPoint) + 'href' => $entryPoint, ] ) ),