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: Expose isIncluded in module info #4305

Merged

Conversation

william57m
Copy link
Contributor

@william57m william57m commented Dec 16, 2021

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 PR exposesisIncluded in ModuleInfo.
In the context of writing plugin, this information can be quite useful to know if a module is included or not (regarding if it is removed by tree-shaking).
While this information can only be valid at some point in the bundling flow, the value will only be valid in the generate phase (BuildPhase.GENERATE). Otherwise, like for external module (where the informations is not available), null is returned.

@william57m william57m changed the title Expose isIncluded in module info feat: Expose isIncluded in module info Dec 16, 2021
@codecov
Copy link

codecov bot commented Dec 17, 2021

Codecov Report

Merging #4305 (094e258) into master (28cc198) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4305   +/-   ##
=======================================
  Coverage   98.45%   98.45%           
=======================================
  Files         205      205           
  Lines        7311     7314    +3     
  Branches     2082     2083    +1     
=======================================
+ Hits         7198     7201    +3     
  Misses         55       55           
  Partials       58       58           
Impacted Files Coverage Δ
src/ExternalModule.ts 100.00% <ø> (ø)
src/Module.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28cc198...094e258. Read the comment docs.

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks a lot!

@lukastaegert lukastaegert merged commit a37e6ad into rollup:master Dec 18, 2021
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.

Expose isIncluded
2 participants