Imported snippets don't reload automatically
Describe the bug
Whenever I use the <<< syntax to import a code snippet, and change the given file's contents, it doesn't get refreshed in the presentation until I do either:
- modify the exact slide that includes the snippet
- restart slidev altogether
Minimal reproduction
Steps to reproduce the behavior:
- Create a sample project
- Import a snippet
- Start slidev and open the slides
- Modify snippet
- Check if it's reflected in the slides
Environment
- Slidev version: 52.1.0
- Browser: Firefox
- OS: macOS
It seems to me like the last added snippet is actually reloaded, all the previous ones are not, so it feels like only the last file is monitored for changes, but I haven't checked the code, so I'm not sure if this assumption is correct, just thought to add it here in case it can help debugging the issue. I'll try to have a look at the code once I have time
I am afraid that I can't reproduce the issue - I may have gotten some steps wrong. Could you create a reproduction on https://sli.dev/new?
Yes, I was just able to reproduce it there.
- Go to https://stackblitz.com/edit/github-diqxvyd9
- Wait for server to start and slides to load
- Open slide 1 in browser
- Edit
snippets/external.tsand save. You will probably see it reflected in the slide - Open slide 2 in browser
- Edit
snippets/second.tsand save. This reproduces the problem for me.
I think @pasdam's comment is crucial - multiple snippets enable / make it easier to hit the problem.