Version 4.0.2

July 16, 2022

Changed

  • 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

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

May 15, 2022

Added

  • Initial Craft CMS 4 release

Fixed

  • 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

Changed

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

Fixed

  • 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

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.1 via Rector

Version 4.0.0-beta.1

February 7, 2022

Added

  • Initial Craft CMS 4 compatibility

Version 1.0.23

January 21, 2022

Fixed

  • Removed errant debugging code

Version 1.0.22

January 20, 2022

Added

Version 1.0.21

January 17, 2022

Added

  • Added a vite-script-loaded event dispatched to document so listeners can be notified after a script loads (#310)

Version 1.0.20

December 16, 2021

Fixed

  • Fixed a regression caused by #5 to ensure assets load on production (#6)

Version 1.0.19

December 15, 2021

Added

  • Added the .entry() function to retrieve and entry from the manifest.json to a JavaScript file, CSS file, or asset

Version 1.0.18

December 14, 2021

Fixed

  • Fixed an issue where the needle/haystack logic was reversed in strpos() which could cause it to not match properly in some setups (#5)

Version 1.0.17

October 21, 2021

Fixed

  • Fixed an issue with potentially duplicated modulepreload links by adding tags via an associative array (#16)

Version 1.0.16

September 18, 2021

Added

  • Added craft.vite.asset() to retrive assets such as images that are imported in JavaScript or CSS

Version 1.0.15

August 25, 2021

Changed

  • Changed the DEVMODE_CACHE_DURATION to 1 second (#3)

Version 1.0.14

August 10, 2021

Added

Version 1.0.13

July 14, 2021

Added

  • Added a craft.vite.devServerRunning() method to allow you to determine if the Vite dev server is running or not from your Twig templates (#10)

Version 1.0.12

July 14, 2021

Changed

  • Switched the checkDevServer test file to @vite/client to accommodate with the change in Vite ^2.4.0 to use the .mjs extension (#11)

Version 1.0.11

June 29, 2021

Changed

  • Roll back the automatic inclusion of @vite/client.js (#9)

Version 1.0.10

June 28, 2021

Changed

  • Always include the @vite/client.js script if the dev server is running (#9)

Version 1.0.9

June 5, 2021

Added

  • Added craft.vite.getCssHash() that returns the content hash for the build CSS assets

Version 1.0.8

June 5, 2021

Added

  • Added craft.vite.includeCriticalCssTags() to make it easy to include inline Critical CSS generated via rollup-plugin-critical

Version 1.0.7

May 21, 2021

Added

  • Added a includeReactRefreshShim setting that will automatically include the required shim for react-refresh when the Vite dev server is running (#5)

Changed

  • Removed custom user/agent header that was a holdover from curl
  • Re-worked how the various JavaScript shims are stored and injected

Version 1.0.6

May 20, 2021

Changed

  • Change the default useDevServer setting to App::env('ENVIRONMENT') === 'dev' (#6)
  • Refactored the code from a monolithic ViteService to helpers, as appropriate

Fixed

  • Fixed an issue where it was outputting type="nomodule" for legacy scripts, when it should have just been nomodule

Version 1.0.5

May 14, 2021

Added

  • Moved the live reload through Twig errors to the ViteService so that plugins can get it too
  • Added .inline() to allow for inlining of local or remote files in your templates, with a caching layer

Changed

  • Use registerJsFile() instead of registerScript()
  • Make the cache last for 30 seconds with devMode on
  • Refactored to ViteVariableInterface & ViteVariableTrait

Version 1.0.4

May 8, 2021

Added

  • Added the devServerInternal setting back in, along with checkDevServer for people who want the fallback behavior (#2)

Changed

  • Use PRIMARY_SITE_URL in the default config instead of SITE_URL
  • Switch over to VitePress for the docs

Version 1.0.3

May 7, 2021

Changed

  • Crawl the manifest.json dependency graph recursively to look for CSS files

Fixed

  • Don't call any AssetManager methods in the component init() method during console requests

Version 1.0.2

May 6, 2021

Changed

  • Removed entirely the devServerInternal setting, which isn't necessary (we just depend on you setting the useDevServer flag correctly instead), and added setup complexity

Version 1.0.1

May 4, 2021

Changed

  • Added initial documentation
  • Updated default config.php

Version 1.0.0

May 3, 2021

Added

  • Initial release