-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support watching feature #42
base: master
Are you sure you want to change the base?
Conversation
guanghechen
commented
Apr 27, 2020
- Pass additional filePath info into transform func
- Add watchStart feature, trigger recopy when files changed
Codecov Report
@@ Coverage Diff @@
## master #42 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 50 75 +25
Branches 17 21 +4
=========================================
+ Hits 50 75 +25
Continue to review full report at Codecov.
|
Any plans to merge this in @vladshcherbin ? |
I think maybe you can use @guanghechen/rollup-plugin-copy as a temporary alternative. |
@guanghechen Thanks for adding watch mode support. I tried to use your fork to copy some files from the build output directory to another location but it results in an infinite loop of builds. Somehow your fork seems to update the files in the source location and then rollup restarts the build process or something. My configuration looks like this:
Do you have an idea what could cause this? |
Ok, found it. Your plugin calls addWatchFile to instruct rollup to watch for changes ... in the build output directory in my case 🤦♀️. Obviously this does not make sense as the fresh build output is then immendiately picked up as changed and another build step is triggered. Fortunately rollup provides an option to exclude certain files from watch. I extended my configuration with
and now it works perfectly. When I think about it now, it seems that I don't need the changes in your fork as I'm simply copying the build output file and these files don't need watching as the copy plugin would be triggered anyway when rollup initiates the build. |
Installed the fork and this works for me! Thanks! 👍 |