Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Svelte Hot Reloading Issue

Recently started playing with Svelte using the sveltejs template. Everything is working fine, however when I do any change in the files it doesn't hot reload the changes to the web browser, so I have to manually refresh the page to see the changes. Is there any option in the settings to enable that feature or is it not possible at this point?

like image 924
Ben Dev Avatar asked Apr 25 '19 04:04

Ben Dev


1 Answers

The default template (https://github.com/sveltejs/template) uses Rollup, which doesn't support hot module reloading. The webpack version (https://github.com/sveltejs/template-webpack) will support HMR, but first we need to add some hooks to Svelte itself to make it possible. There's an issue you can track here — hopefully we'll be able to do this work soon.

Until then, Tholle's suggestion of using the livereload plugin is probably the best compromise.

like image 160
Rich Harris Avatar answered Sep 30 '22 16:09

Rich Harris