Description
Here’s the command as it is now:
cloudflare-docs-engine/bin/commands.sh
Lines 63 to 74 in 765bc30
What it does is it copies the host project’s content into the engine’s .docs/src/content
directory and then runs npm run develop
in there. The problem with this is that changes to content inside src/content
aren’t watched by the npm run develop
watcher inside .docs
.
A quick-ish hack would be to have the engine run its own watcher when you run npm run develop
, and have it re-run copysrc
on changes to src/content
, copying files into .docs/src/content
which would kick off the watcher in there. This seems like a really bad approach which is why we have not implemented it yet.
While no solution we’ve found yet is ideal, one current workaround is to run npm run develop
and then once it’s running, make your changes to .docs/src/content
. These will be watched by the internal npm run develop
’s watcher, and everything will function normally as developers are used to. The big caveat is that once you’re done with all of your local changes, then you need to _manually copy .docs/src/content
back into src/content
. Worse, if you accidentally run npm run develop
again (in the root) you’ll end up overwriting what you had been working on inside .docs/src/content
when copysrc
is called. So yea, pretty gross.
The more straight-forward alternative is to simply cancel and re-run npm run develop
every time you want to see your changes. The problem with this of course is it’s slow, requiring Gatsby to start up again each time, and labor intensive as it requires you to manually run a command to see changes rather than see them change immediately.
All of this is to say, the current local development setup needs work.