( watcher: FSWatcher, file: string | null, root: string, )
| 736 | } |
| 737 | |
| 738 | export function ensureWatchedFile( |
| 739 | watcher: FSWatcher, |
| 740 | file: string | null, |
| 741 | root: string, |
| 742 | ): void { |
| 743 | if ( |
| 744 | file && |
| 745 | // only need to watch if out of root |
| 746 | !file.startsWith(withTrailingSlash(root)) && |
| 747 | // some rollup plugins use null bytes for private resolved Ids |
| 748 | !file.includes('\0') && |
| 749 | fs.existsSync(file) |
| 750 | ) { |
| 751 | // resolve file to normalized system path |
| 752 | watcher.add(path.resolve(file)) |
| 753 | } |
| 754 | } |
| 755 | |
| 756 | interface ImageCandidate { |
| 757 | url: string |
no test coverage detected