Skip to content
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

Add watch mode support for target files #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

uraitakahito
Copy link

Add watch mode support for target files

What does this PR do?

The following changes have been made:

  • Added a feature to watch for changes in files specified in targets' src during watch mode.
  • Only changes in input and targets' src are detected. In other words, targets' dest is not monitored.
  • This feature is OFF by default to maintain compatibility with the current behavior.
  • Adds relevant tests to ensure the new feature works as expected.

Motivation

Because I want rollup to automatically rerun when assets other than JavaScript are changed during web application development.

Describe how you validated your changes

I have confirmed that all existing tests pass and added new tests. Additionally, I created a repository for testing, which can be found here.

Possible Drawbacks / Trade-offs

The current implementation re-copies all targets instead of just the modified file, which is inefficient. Users should be aware of this limitation. I hope to address this in a separate pull request if possible.

Additional Notes

  • addWatchFile is prohibited from being called in the buildEnd event. Therefore, the registration of watch targets is fixed to the buildStart event.
  • A temporary package with the new feature is available here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant