lukeed / taskr

A fast, concurrency-focused task automation tool.
MIT License
2.53k stars 74 forks source link

load `chokidar` lazily #236

Closed lukeed closed 7 years ago

lukeed commented 7 years ago

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.