vladshcherbin / rollup-plugin-copy

Copy files and folders using Rollup
270 stars 54 forks source link

Support rollup's watch mode #5

Open quotquot opened 6 years ago

quotquot commented 6 years ago

When running rollup in watch mode, if a change is made to a copied asset, the modified asset should be copied again to the target directory. Right now one has to kill the watch process and re-run it for the copy to be done. It breaks the "mental flow" of development since one has to constantly remember that changes made to the edited buffer are not propagated automatically, unlike other sources. How many times have I reloaded the web page, wondered why it's not working, before realizing I forgot to kill the watch process and rerun it?

thecristen commented 6 years ago

A workaround is to make a change to one of the files that is watched, which will trigger the copy without having to kill the watch process.

gerwinbrunner commented 3 years ago

Any update on this?

MickL commented 3 years ago

I was not sure if it is supposed to watch the files or not because there is this copyOnce option.

mindplay-dk commented 3 years ago

To others desperately searching for a solution to this, there's a fork here that worked for me:

https://www.npmjs.com/package/@guanghechen/rollup-plugin-copy

There is an open PR #42 from the author as well:

A comment on that PR says to use watch: { exclude: 'build/**' } - I didn't need to do that, it just worked.

ViRuSTriNiTy commented 3 years ago

@mindplay-dk That exclude configuration is only needed when you try to watch files in the build folder (often named dist). As I already commented in the PR, watching files in the build output doesn't make sense anyway so this setting is not needed at all. Sorry for the confusion.

BreizhReloaded commented 3 years ago

Any update about the PR @vladshcherbin?