feat(compute/serve): implement --watch-dir flag #758
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #646
Context
The
--watch
flag (for thecompute serve
command) indicates to the Fastly CLI that all files within the Compute@Edge project directory need to be watched for changes.The Fastly CLI will respect a
.ignore
or.gitignore
file within the project directory (it also respects the user's global git ignore configuration as well).New Feature
I've added a new
--watch-dir
flag which informs the Fastly CLI which directory it should start watching files from (defaults to the current directory, which is expected to be the associated Compute@Edge project directory).Example
I've created a Compute@Edge project nested within another directory:
The Fastly CLI must be run inside the
compute
directory as that is the Compute@Edge project, but now a user can provide the--watch-dir
flag to indicate that changes to files outside of the directory need to be watched:The above example uses a relative path from the
compute
directory up to the parent directory, but an absolute path works as well: