Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix svelte story files not reloading #362

Merged
merged 1 commit into from
May 1, 2022
Merged

Fix svelte story files not reloading #362

merged 1 commit into from
May 1, 2022

Conversation

IanVS
Copy link
Member

@IanVS IanVS commented Apr 29, 2022

Fixes #52

Svelte story files have the same issue as react story files. The webpack HMR seems to prevent vite's HMR from working correctly, so we need to exclude story files as HMR boundaries in vite. The svelte plugin doesn't expose as nice of a way to do this, but thanks to a suggestion from @domyen in sveltejs/vite-plugin-svelte#321 (comment), I was able to make it work.

To test:
Start up the svelte example, edit a .stories.svelte file, and confirm that the page reloads and shows your changes.

@IanVS IanVS requested a review from joshwooding April 29, 2022 13:36
@IanVS IanVS merged commit 3b71dcd into main May 1, 2022
@IanVS IanVS deleted the svelte-stories branch May 1, 2022 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Svelte HMR broken in stories and components
2 participants