Using the engine’s npm run develop
command doesn’t watch for changes
#279
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
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 runsnpm run develop
in there. The problem with this is that changes to content insidesrc/content
aren’t watched by thenpm 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-runcopysrc
on changes tosrc/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 internalnpm 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 intosrc/content
. Worse, if you accidentally runnpm run develop
again (in the root) you’ll end up overwriting what you had been working on inside.docs/src/content
whencopysrc
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.
The text was updated successfully, but these errors were encountered: