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

Allow this.addWatchFile in all hooks #5270

Merged
merged 5 commits into from Nov 26, 2023
Merged

Conversation

lukastaegert
Copy link
Member

@lukastaegert lukastaegert commented Nov 25, 2023

also trigger close hook in watch mode

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

This removes any restrictions on this.addWatchFile so that it can now be called in all hooks.

Note that when watch.skipWrite is true, no hooks from the generate phase will be called and closeBundle will not be called.

Last, we now no longer access this in this.addWatchFile.

Copy link

vercel bot commented Nov 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 26, 2023 6:02am

Copy link

github-actions bot commented Nov 25, 2023

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#gh-5260-add-watch-file

Notice: Ensure you have installed Rust nightly. If you haven't installed it yet, please first see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust, then see https://rust-lang.github.io/rustup/concepts/channels.html to learn how to install Rust nightly.

or load it into the REPL:
https://rollup-7c9u7n00s-rollup-js.vercel.app/repl/?pr=5270

also trigger close hook in watch mode
Copy link

codecov bot commented Nov 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (465ae03) 98.86% compared to head (f769150) 98.86%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5270   +/-   ##
=======================================
  Coverage   98.86%   98.86%           
=======================================
  Files         232      232           
  Lines        8950     8952    +2     
  Branches     2334     2335    +1     
=======================================
+ Hits         8848     8850    +2     
  Misses         43       43           
  Partials       59       59           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lukastaegert lukastaegert merged commit 4409e6d into master Nov 26, 2023
27 checks passed
@lukastaegert lukastaegert deleted the gh-5260-add-watch-file branch November 26, 2023 12:09
Copy link

This PR has been released as part of rollup@4.6.0. You can test it via npm install rollup.

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.

Calling this.addWatchFile in load hook throws an error if manualChunks is used
1 participant