-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(v2): add CLI option for polling #2630
Conversation
Some environments (specifically docker containers) can have issues with file watching for live reloads. [Webpack Dev Server provides a polling alternative](https://webpack.js.org/configuration/watch/#watchoptionspoll) option for this
Deploy preview for docusaurus-2 ready! Built with commit ddb7e51 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, I did not know about this feature VS Code, I'm fine with it (only one typo needs to be fixed).
.action((siteDir = '.', {port, host, hotOnly, open}) => { | ||
.option( | ||
'--poll', | ||
'Use polling rather than wathcing for reload (default: false)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: wathcing -> watching
Cheers, sorry for the typos. The remote-containers are really cool when you have a slightly complicated project and want people to be able to just pick up and go like GitPod but local I guess |
Motivation
I've been working with a project that likes to have repos contain VS Code devcontainers so that you can simply open the repo in VS code, load up a configured Docker container and away you go. I have this working 99 % with our Docusaurus 2 repos but live reloading does not work use the
fsevents
andinotify
methods used to watch for file changes in this case. Webpack Dev Server provides a polling alternative option for this and it is noted that this is recommended for such environments.Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
yarn start
to check works with no flag provide. Make some minor edits and check there is an instant reload. It does ✔yarn start --poll
which uses the newly add--poll
option to setwatchOptions.poll
totrue
. Make some minor edits and see a reload after a small delay from the 1 s polling time. It does ✔Related PRs
Docs are (I think) updated correctly. I could not quite ascertain the convention for adding to the changelog so I'm guessing that that is done at release?