As soon as fly.watch was included, the tests took an additional 250ms to complete, see message in 263d7ad4c6180239ae91ded823ce2f17b776254d.
This is because chokidar is a "beefy" module to boot up... and there's no benefit in requiring it before it's needed.
Instead, we can "lazily require" chokidar only when fly.watch is being called, dramatically improving boot & execution speed for instances of Fly that do not use watch.
As soon as
fly.watch
was included, the tests took an additional 250ms to complete, see message in 263d7ad4c6180239ae91ded823ce2f17b776254d.This is because
chokidar
is a "beefy" module to boot up... and there's no benefit in requiring it before it's needed.Instead, we can "lazily require"
chokidar
only whenfly.watch
is being called, dramatically improving boot & execution speed for instances of Fly that do not usewatch
.