Custom source plugin - update nodes when source changes (in develop mode) #33340
Unanswered
jugglingcats
asked this question in
Help
Replies: 1 comment 1 reply
-
|
I managed to get this working with the following code at the end of my |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a simple source plugin that reads a single input file and creates a set of nodes that are then used for navigation and content pages in my site.
When this file changes in develop mode I'd like to update the nodes and view the changes. At the moment I have to restart Gatsby to see any changes. It would be enough to see changes to the content of existing nodes - I could live with restarting Gatsby to pick up new/deleted nodes.
I've read the docs and even had a look at the Contentful plugin source, but can't see the mechanism for re-executing a plugin when its input changes.
Perhaps the simple answer is that I must watch the file myself in the plugin and re-create nodes on changes. That's what the filesystem plugin seems to do (using chokidar).
Any help much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions