Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add chokidar options This adds --watch, --nowatch, and --poll to the options that micro-dev can accept. * --watch allows passing directories to be watched, ignoring others In case you have only one or a few directories to be watched, and churn in others, you can do, e.g. `-w lib -w test` * --nowatch disables watching entirely In case you do not want to watch the file system for changes at all, as in #10 * --poll uses chokidar's polling method rather than filesystem events In case you are doing local development across an NFS mount or in a shared volume from a docker container, using -L will enable watching to work anyway. The -L is used as the short form because nodemon uses it for the same purpose, and we can't use -p as that is already in use for --port. * fix travis warnings * typo fix to actually allow nowatch * Improved help * Prevent prettier from breaking help * Made usage description even shorter * Use --cold instead of --nowatch * Error definition added
- Loading branch information
1 parent
cbd1fcd
commit 33ecb09
Showing
5 changed files
with
66 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Too Many Watch Flags | ||
|
||
#### Why This Error Occurred | ||
|
||
When you ran the `micro-dev` command with the `--cold` flag (which disables hot reloading), you've defined more flags that are also related to hot reloading. This is not allowed! | ||
|
||
#### Possible Ways to Fix It | ||
|
||
When using `--cold`, you cannot use `--watch` or `--poll`. To use one of the latter two flags, you need to enable hot reloading (leave the `--cold` flag away). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
module.exports = (message, errorCode) => { | ||
const repo = errorCode === 'watch-flags' ? 'micro-dev' : 'micro' | ||
|
||
console.error(message) | ||
console.error(`Read more here: https://err.sh/micro/${errorCode}`) | ||
console.error(`Read more here: https://err.sh/${repo}/${errorCode}`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters