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

feat: capture watch mode when called via the Rollup API #384

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

agilgur5
Copy link
Collaborator

Summary

Capture this.meta.watchMode when it is available

Details

  • process.env.ROLLUP_WATCH is only set when using the CLI

    • when using watch mode through the Rollup API, this is not set
    • but since Rollup 2.14.0, this.meta.watchMode is available
      • still check the env variable for backward-compat on older Rollup versions
  • notably, this is needed to test watch mode, since the tests are done via the Rollup API

- `process.env.ROLLUP_WATCH` is only set when using the CLI
  - when using watch mode through the Rollup API (https://rollupjs.org/guide/en/#rollupwatch), this is not set
  - but since Rollup 2.14.0 (https://github.com/rollup/rollup/blob/master/CHANGELOG.md#2140), `this.meta.watchMode` is available
    - still check the env variable for backward-compat on older Rollup versions

- notably, this is needed to test watch mode, since the tests are done via the Rollup API
@agilgur5 agilgur5 added kind: feature New feature or request scope: tests Tests could be improved. Or changes that only affect tests scope: watch mode Related to Rollup's watch mode labels Jul 10, 2022
@ezolenko ezolenko merged commit af271af into ezolenko:master Jul 12, 2022
@agilgur5 agilgur5 deleted the feat-capture-watchMode-api branch July 2, 2023 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: feature New feature or request scope: tests Tests could be improved. Or changes that only affect tests scope: watch mode Related to Rollup's watch mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants