rollup-plugin-copy icon indicating copy to clipboard operation
rollup-plugin-copy copied to clipboard

Watch target files with Chokidar

Open blake-mealey opened this issue 6 years ago • 6 comments

Fixes: #5

New PR for watching targeted files, this time using Chokidar as we discussed.

We discussed using process.on('exit', ...) to close watchers, but I found this wasn't feasible because that requires sync operations and closing Chokidar is async. I made an issue on Chokidar and they said there's no need to close them manually (see https://github.com/paulmillr/chokidar/issues/945).

blake-mealey avatar Nov 05 '19 16:11 blake-mealey

Codecov Report

Merging #30 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #30   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          36     49   +13     
  Branches       12     14    +2     
=====================================
+ Hits           36     49   +13
Impacted Files Coverage Δ
src/index.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 57df513...4d6431c. Read the comment docs.

codecov[bot] avatar Nov 05 '19 16:11 codecov[bot]

Time to check this one, thank you for helping :)

vladshcherbin avatar Nov 20 '19 06:11 vladshcherbin

I've checked and tested this a bit. Everything is fine, except glob support. Chokidar uses picomatch inside which has less features than glob package used for copying here.

I'm not sure how to solve this, need to find a way chokidar use micromatch like it was in v2. Maybe it's possible to pass glob library instance or smth like this.

Details

vladshcherbin avatar Dec 10 '19 13:12 vladshcherbin

This can be accomplished with rollup's addWatchFile API, no?

bennypowers avatar Jan 31 '20 09:01 bennypowers

@bennypowers unfortunately that didn't fit all requirements, see: https://github.com/vladshcherbin/rollup-plugin-copy/pull/27#issuecomment-546780835

@vladshcherbin any update on merging this?

blake-mealey avatar Feb 01 '20 00:02 blake-mealey

Bump 😃

blake-mealey avatar May 29 '20 20:05 blake-mealey