watchDirectory
In development, watchDirectory
will reload the Astro dev server if any files within
the directory change. For example:
Limitations
Those are due to limitations in Astro core:
- This utility watches all files deeply under the specified directory
- Only files are considered. Directories themselves are not watched (eg. an empty folder is deleted)
- Files added to the directory won’t cause a reload and won’t be watched for further changes until one of the old files is changed or the dev server is restarted