You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add renderStylePreloads method and corresponding Twig function for CSS preload hints
- Implemented renderStylePreloads in ViteManifest to generate <link rel="preload" as="style"> tags for CSS files.
- Added vite_css_preload Twig function to utilize the new method.
- Updated README and CHANGELOG to reflect these changes.
- Added tests for style preload functionality and ensured compatibility with existing features.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
5
5
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
7
+
## 1.2.0
8
+
- Fix `getStyle()` silently dropping the standalone `.css` output file when a chunk also has a `css[]` array (assignment was overwriting instead of merging)
9
+
- Add `renderStylePreloads()` method to `ViteManifest` and `ViteManifestInterface` to emit `<link rel="preload" as="style">` hints for CSS files
10
+
- Add `vite_css_preload()` Twig function backed by `renderStylePreloads()`
11
+
7
12
## 1.1.0
8
13
- Support CSS standalone file by [@imagoiq](https://github.com/imagoiq) in [#1](https://github.com/userfrosting/vite-php-twig/pull/1)
-`vite_css_preload` — renders `<link rel="preload" as="style">` hints so the browser discovers CSS files earlier, even though `vite_css` already adds the `<link rel="stylesheet">` tags.
79
+
73
80
If you have multiple entry point scripts on the same page, you should pass them in a single call to avoid duplicates - for example:
0 commit comments