rollup / rollup-watch

Fast incremental rebuilds with Rollup CLI
MIT License
91 stars 23 forks source link

Various #50

Closed Rich-Harris closed 7 years ago

Rich-Harris commented 7 years ago

After merging #47, I started getting weird errors on OS X. I think there's some platform-specific nonsense that affects fs.watch from behaving correctly if you're writing to the filesystem very quickly (as the tests do) — sticking a 100ms delay before each function that manipulates the filesystem in the tests appears to fix it. I just hope that's not masking a bug that appears in real-world usage.

In the process of this I added a useChokidar option so that it's possible to test both chokidar and fs.watch (i.e. it's not solely determined by whether or not chokidar can be found). Not that you'd do this in real life, but as of Rollup 0.42 you can pass this option through like so:

// rollup.config.js
export default {
  // other options...
  ...,
  watch: { useChokidar: true }
};