JSPM

  • Created
  • Published
  • Downloads 298418
  • Score
    100M100P100Q174026F
  • License ISC

Bundler agnostic HMR utils for Svelte 3

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

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 writing), but I'm adding it for future reference.

Some initial work has also been made on supporting Sapper with Rollup, and basic support for simple cases is available. But this one is still in very early stages (and, again, poorly documented for now, sorry). I could really use some help with this one actually, if you're in the mood ;)

Svelte Native

The official Svelte Native template already includes HMR support.

License

ISC