]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: add link to Vite HMR API (#2564)
authorHoward Guo <50100922+toto6038@users.noreply.github.com>
Fri, 2 Feb 2024 10:48:08 +0000 (18:48 +0800)
committerGitHub <noreply@github.com>
Fri, 2 Feb 2024 10:48:08 +0000 (11:48 +0100)
* Update hot-module-replacement.md

* fix line break

* Update packages/docs/cookbook/hot-module-replacement.md

---------

Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
packages/docs/cookbook/hot-module-replacement.md

index 37bce74d0b6621c2bd752b787107d646a6f07872..af5d6bd5faa08861c966bc3c3db76dc8b6349171 100644 (file)
@@ -2,7 +2,7 @@
 
 Pinia supports Hot Module replacement so you can edit your stores and interact with them directly in your app without reloading the page, allowing you to keep the existing state, add, or even remove state, actions, and getters.
 
-At the moment, only [Vite](https://vitejs.dev/) is officially supported but any bundler implementing the `import.meta.hot` spec should work (e.g. [webpack](https://webpack.js.org/api/module-variables/#importmetawebpackhot) seems to use `import.meta.webpackHot` instead of `import.meta.hot`).
+At the moment, only [Vite](https://vitejs.dev/guide/api-hmr.html#hmr-api) is officially supported but any bundler implementing the `import.meta.hot` spec should work (e.g. [webpack](https://webpack.js.org/api/module-variables/#importmetawebpackhot) seems to use `import.meta.webpackHot` instead of `import.meta.hot`). 
 You need to add this snippet of code next to any store declaration. Let's say you have three stores: `auth.js`, `cart.js`, and `chat.js`, you will have to add (and adapt) this after the creation of the _store definition_:
 
 ```js