fix file watching

This commit is contained in:
Rich Harris
2018-08-19 18:55:09 -04:00
parent 611017fd28
commit 0fb5827968

View File

@@ -455,8 +455,9 @@ function noop() {}
function watch_files(pattern: string, events: string[], callback: () => void) { function watch_files(pattern: string, events: string[], callback: () => void) {
let watcher; let watcher;
let closed = false;
import('chokidar').then(({ default: chokidar }) => { import('chokidar').then((chokidar) => {
if (closed) return; if (closed) return;
watcher = chokidar.watch(pattern, { watcher = chokidar.watch(pattern, {