-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
HMR not working on import code snippets #117
Comments
@yuxino Hi! I can't even make code snippet import to work in the first place 😅 Your reproduction repo is 404, could you fix that? |
@kiaking my bad ,now repo is public |
OK thanks! I've confirmed it. I'm not sure if this feature is fully supported yet... 😅 Let's mark this issue as an enhancement and see if we can make it work. |
any update on this feature? |
This comment was marked as outdated.
This comment was marked as outdated.
Also not on imported markdown files. HMR is triggering for them, but we are using custom |
https://github.com/vuejs/vitepress/compare/chore/vite-3...fix/hmr?expand=1 -- these changes seem to fix this. But I'm not sure if this is proper/elegant way to do stuff. |
I also met. Hope to be fixed. |
@brc-dd said:
This link isn't working (anymore?). What did your kludgy fix do? |
Ah, that vite-3 branch was deleted after merging. That HMR branch is still there (outdated though). These were the changes I was referring to: 7dbceaa?w=1 |
Is there any more progress on this? I can see how to do it in a fork, but I'd rather not rely on code that will inevitably become stale. If I'm thinking about this correctly, what we need is a way to augment the Adding a way to collect additional includes to the markdown-it |
Ah, I can see that this problem exists even if an I still think that it would be good to let markdown plugins do custom includes, but perhaps the API needs to be rich enough to support HMR. If there's interest, I can dig into that 😄 |
The solution in #2581 seems to work for most cases, but one might also need to add some plugin like https://github.com/ElMassimo/vite-plugin-full-reload e.g. in cases where a vue component is both imported and included as code snippet. |
Okay, so this should work fine without any extra config in next version. I went with a slightly modified approach of what I had earlier proposed in 7dbceaa |
Describe the bug
HMR not working on import code snippets
To Reproduce
Steps to reproduce the behavior:
see this video
hello.vue
contentExpected behavior
auto update code
System Info
The text was updated successfully, but these errors were encountered: