| 39 | // in the JavaScript output. |
| 40 | let FSWatcher: typeof import('chokidar').FSWatcher; |
| 41 | function loadFSWatcher() { |
| 42 | if (!FSWatcher) { |
| 43 | try { |
| 44 | FSWatcher = require('chokidar').FSWatcher; |
| 45 | } catch (e) { |
| 46 | if ((e as NodeJS.ErrnoException).code !== 'MODULE_NOT_FOUND') { |
| 47 | throw new Error( |
| 48 | 'As of angular-devkit version 8.0, the "chokidar" package ' + |
| 49 | 'must be installed in order to use watch() features.', |
| 50 | { |
| 51 | cause: e, |
| 52 | }, |
| 53 | ); |
| 54 | } |
| 55 | throw e; |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * An implementation of the Virtual FS using Node as the background. There are two versions; one |