Package Exports
- svelte-hmr
- svelte-hmr/runtime
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (svelte-hmr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
svelte-hmr
HMR commons for Svelte 3.
This packages provides shared dependencies for implementing Svelte HMR in any bundler plugins.
If you want to use HMR in your Svelte project, what you need is a HMR enabled plugin for your bundler (e.g. Rollup or Webpack). See available options in the following list.
On the other hand, if you are really developing a plugin... Sorry, no docs for now! Drop me a line, I'd be happy to help!
Rollup / Nollup
- svelte-template-hot ⬅️ Recommended starting point
- rollup-plugin-svelte-hot
HMR support for Rollup
Rollup does not natively support HMR. You'll need to use one of the following solutions. The best way to get started is to refer to svelte-template-hot, that demonstrates usage of both.
Webpack
Documentation & examples for Webpack are currently lagging behind...
Sapper
Sapper can be supported with Webpack's loader. The link bellow is still very much a work in progress (no docs at time of writting), but I'm adding it for future reference.
Svelte Native
The official Svelte Native template already includes HMR support.