HMR not working on import code snippets
See original GitHub issueDescribe the bug
HMR not working on import code snippets
To Reproduce
Steps to reproduce the behavior:
see this video
- git clone https://github.com/febug/vitepress-import-code-snippet.git
- yarn
- yarn serve
- edit
hello.vue
content
Expected behavior
auto update code
System Info
- vitepress version: 0.7.2
- Node version: v13.14.0
- OS version: osx 10.15.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
WebPack HMR - run code if HMR server is not found
I got this basic Javascript code which is compiled by webpack. I am using Hot Module Replacement for Styles and Javascript.
Read more >HMR - NGXS
Hot Module Replacement (HMR) is a Webpack feature to update code in a running app without rebuilding it. This results in faster updates...
Read more >Hot Module Replacement (HMR) API - Snowpack
Snowpack implements HMR via the esm-hmr spec, an attempted standard for ESM-based ... HMR Code Snippet Example if (undefined /* [snowpack] import.meta.hot ...
Read more >Vite Hot Module Replacement - A Complete Example
import HotModuleReloadSetup from './HotModuleReloadSetup.js'; // Setup HMR const hmr = new HotModuleReloadSetup(); ...
Read more >React Snowpack HMR - ReScript Forum
I don't have any problems with getting it working, just interested ... I'm not even sure what that code snippet does, so any...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
Ah, I can see that this problem exists even if an
include
is added. I was so focused on my use-case that I didn’t notice that the HMR issue exists even ifserver.addWatchFile
is used.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 😄