mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-20 06:15:15 +00:00
fix file watching
This commit is contained in:
@@ -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, {
|
||||||
|
|||||||
Reference in New Issue
Block a user