Skip to content

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