Version 4.0.10
August 13, 2024
Added
- Added a
craft.vite.integrity()method that will extract the integrity hash (for building a Content Security Policy) - Added an
includeScriptOnloadHandlerconfig setting that allows you to disable the adding of anonloadhandler on the<script>tags (useful when implementing a Content Security Policy)
Changed
- Filter out empty attributes so they don't render on the
<script>tags
Fixed
- Use
strrposinstead ofstrposwhen attempting to extract a file name without the hash (#28)
Version 4.0.8
January 30, 2024
Added
- If the
devServeris running, theViteService::fetch()method will try to use thedevServerInternalURL first, falling back on thedevServerPublicso thatcraft.vite.inline()can pull from thedevServerif it is running (#22) - Add
phpstanandecscode linting - Add
code-analysis.yamlGitHub action
Changed
- Updated docs to use node 20 & a new sitemap plugin
- PHPstan code cleanup
- ECS code cleanup
Version 4.0.6
June 7, 2023
Added
- Add the
getCssInlineTags()function to theViteVariableso it's accessible via Twig templates - Added the
create-releaseGitHub workflow to automate release tagging
Version 4.0.5
January 25, 2023
Changed
- Updated the
craft.vite.asset()function to work with Vite 3.x or later, where assets are stored as top-level entries in themanifest.json(#56) (#31) - You can now include CSS manually if it's a top-level entry in your
vite.config.js(rather than being imported into your JavaScript) viacraft.vite.asset("src/css/app.css")(#31)
Version 4.0.4
January 1, 2023
Changed
- Move to using
ServicesTraitand add getter methods for services - Update the docs to use Vitepress
^1.0.0-alpha.29
Fixed
- Fixed an issue where
craft.vite.includeCriticalCssTags()would fail if you hadtemplatein the file path (#45)
Version 4.0.3
September 9, 2022
Added
- Added support for detecting dev-mode in Craft CMS v4 by changing
App::env('ENVIRONMENT') === 'dev' - to
App::env('ENVIRONMENT') === 'dev' || App::env('CRAFT_ENVIRONMENT') === 'dev'(#41)
Fixed
- Set the
ViteServiceconfig in the constructor, so that settings from theconfig/vite.phpare pre-populated before theViteService::init()method is called (#44)
Version 4.0.2
July 16, 2022
Changed
- Fixed an issue where
checkDevServerdidn't work with Vite 3, because they removed the intercepting of__vite_ping(#37)
Version 4.0.1
June 29, 2022
Changed
- Adds a boolean as a second param to the
craft.vite.asset(url, true)so that assets in the vite public folder can be referenced correctly from Twig (#9)
Version 4.0.0-beta.4
April 26, 2022
Changed
- Don't log the full exception on a Guzzle error, just log the message
Fixed
- Fix semver for
nystudio107/craft-plugin-viteso it's not pinned to a specific version
Version 4.0.0-beta.3
March 22, 2022
Changed
- Only clear caches in
init()if we're using the dev server - Cache the status of the devServer for the duration of the request
Version 4.0.0-beta.2
March 4, 2022
Fixed
- Updated types for Craft CMS
4.0.0-alpha.1via Rector
Version 4.0.0-beta.1
February 7, 2022
Added
- Initial Craft CMS 4 compatibility