For the react4xp starter it would be nice to have the watch work more consistently across the different view modes in Content Studio, and based on if we render the component client- or server-side.
I tried out the React4xp starter, and followed the first 7 chapters from the guide: Setting up your project - Enonic Developer Portal .
I ran the deploy and started the server with
enonic project deploy --dev.
Then I wanted to try out
npm run watch. After a discussion in your Slack I got it to run locally, and Espen Norderud collected issues here https://github.com/enonic/lib-react4xp/issues/344.
There are still some things that do not run as expected (and I was asked by Thomas Sigdestad to create this feature request). Files in the
ENTRY_DIRS are most of the times not updated in the browser. I found that changing a file in the
ENTRY_DIRS gives different behavior based on if it is loaded with server-side rendering or not, or if it is in preview or edit mode. I have summarized my findings in a pdf, which was sent in the original question in your Slack, but I can’t seem to find a way to add it here.
In the original discussion in your Slack, I also received a tip to try running “Continous building”, so I tried this by running
enonic project gradle deploy --continuous . This helps, but not for SCSS files in
ENTRY_DIRS if we are in edit mode. I have also added these findings in the pdf mentioned above.