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
feat(watch): add skipWrite
option
#3454
Conversation
``` | ||
rollup -i input.js -f es -p ./my-plugin.js | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, these look to be my editor's auto-trimming
@@ -1096,6 +1096,13 @@ Default: `true` | |||
|
|||
Whether to clear the screen when a rebuild is triggered. | |||
|
|||
#### watch.skipWrite | |||
Type: `boolean`<br> | |||
<!-- CLI: `--watch.skipWrite`<br> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This CLI option will work, but I figure it's better not to list it (similar to watch.chokidar
) since its application makes zero sense via the CLI layer.
Codecov Report
@@ Coverage Diff @@
## master #3454 +/- ##
==========================================
+ Coverage 95.02% 95.02% +<.01%
==========================================
Files 171 171
Lines 5851 5852 +1
Branches 1726 1727 +1
==========================================
+ Hits 5560 5561 +1
Misses 157 157
Partials 134 134
Continue to review full report at Codecov.
|
@@ -174,7 +176,7 @@ export class Task { | |||
return; | |||
} | |||
this.updateWatchedFiles(result); | |||
await Promise.all(this.outputs.map(output => result.write(output))); | |||
this.skipWrite || (await Promise.all(this.outputs.map(output => result.write(output)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where the new option is applied.
(Not a fan of how the linter formatted it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sensible to me 👍
Nice. This I need to get my hands on the return value from
Is there anything I can do to help get this ready for release? |
Thanks! |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers: #3225
Description
This change allows programmatic
rollup.watch
users to opt out of automaticbundle.write
calls. This definitely won't be the common use case, but it's been requested (a few times) in the past for certain scenarios.