* On file changes, we will perform a rebuild and/or reload the browser depending on the file extension being detected. * We add a setTimeout delay to throttle the callbacks to avoid calling the build too often. * @param {String} filepath - file path that changed
(filepath)
| 104 | * @param {String} filepath - file path that changed |
| 105 | */ |
| 106 | function onFileChanged(filepath) { |
| 107 | if (timer) { |
| 108 | clearTimeout(timer); |
| 109 | } |
| 110 | changedFiles.add(filepath); |
| 111 | timer = setTimeout(() => { |
| 112 | executeCommandCallback(Array.from(changedFiles).pop()); |
| 113 | }, 150); |
| 114 | } |
| 115 | |
| 116 | function hasQueuedChanges() { |
| 117 | if (changedFiles.size > 0) { |
no test coverage detected