Version 4.0.9

March 2, 2024


  • Add documentation for Craft Cloud usage with Vite (#83)
  • Add support for clearing Vite caches in response to Craft Cloud's UpController::EVENT_AFTER_UP event (#83)


  • Fixed an issue where the wrong CSS hash would be returned if you were using Vite 3 or earlier (#80)
  • Fixed an issue where craft.vite.entry() would fail if you were using Vite 5 or later, due to the ManifestHelper::fileNameWithoutHash() function not working correctly (#24)

Version 4.0.8

January 30, 2024


  • If the devServer is running, the ViteService::fetch() method will try to use the devServerInternal URL first, falling back on the devServerPublic so that craft.vite.inline() can pull from the devServer if it is running (#22)
  • Add phpstan and ecs code linting
  • Add code-analysis.yaml GitHub action


  • Updated docs to use node 20 & a new sitemap plugin
  • PHPstan code cleanup
  • ECS code cleanup

Version 4.0.7

December 8, 2023


  • Fixed a type error if you passed an array of entries into the errorEntry config (#76)
  • Fixed an issue where the craft.vite.getCssHash() function didn't work with Vite 5, because it now uses a - to separate the version hash (#21)

Version 4.0.6

June 7, 2023


  • Add the getCssInlineTags() function to the ViteVariable so it's accessible via Twig templates
  • Added the create-release GitHub workflow to automate release tagging

Version 4.0.5

January 25, 2023


  • Updated the craft.vite.asset() function to work with Vite 3.x or later, where assets are stored as top-level entries in the manifest.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) via craft.vite.asset("src/css/app.css") (#31)

Version 4.0.4

January 1, 2023


  • Move to using ServicesTrait and add getter methods for services
  • Update the docs to use Vitepress ^1.0.0-alpha.29


  • Fixed an issue where craft.vite.includeCriticalCssTags() would fail if you had template in the file path (#45)

Version 4.0.3

September 9, 2022


  • 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)


  • Set the ViteService config in the constructor, so that settings from the config/vite.php are pre-populated before the ViteService::init() method is called (#44)

Version 4.0.2

July 16, 2022


  • Fixed an issue where checkDevServer didn't work with Vite 3, because they removed the intercepting of __vite_ping (#37)

Version 4.0.1

June 29, 2022


  • 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

May 15, 2022


  • Initial Craft CMS 4 release


  • Fixed an issue where the plugin couldn't detect the Vite dev server by testing __vite_ping instead of @vite/client to determine whether the dev server is running or not (#33) (#8)

Version 4.0.0-beta.4

April 26, 2022


  • Don't log the full exception on a Guzzle error, just log the message


  • Fix semver for nystudio107/craft-plugin-vite so it's not pinned to a specific version

Version 4.0.0-beta.3

March 22, 2022


  • 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


  • Updated types for Craft CMS 4.0.0-alpha.1 via Rector

Version 4.0.0-beta.1

February 7, 2022


  • Initial Craft CMS 4 compatibility