Closed arctica closed 3 years ago
As a workaround I just figured that one can use the "filter" option with a function like the following to achieve what I wanted since by default the filter will not affect the summary.
const limiter = (limit) => {
let nth = 0;
return (m) => nth++ < limit;
}
And then analyze({ filter: limiter(5) } )
.
Thanks btw for such a great plugin.
Thanks for the report, just released version 4.0.0 with this behavior changed to not affect the summary (unless filterSummary === true
).
When using "limit", the reported stats are incorrect because they exclude all modules that are beyond the cutoff point. Limit should probably only affect the list of modules in the output, not the calculations.
A simple way to showcase the issue is to set "limit: 0" which will result in something like the following: