ai / size-limit

Calculate the real cost to run your JS app or lib to keep good performance. Show error in pull request if the cost exceeds the limit.
MIT License
6.52k stars 1.82k forks source link

Add statoscope #251

Closed smelukov closed 2 years ago

smelukov commented 2 years ago

It's all about #217

ai commented 2 years ago

The current screenshot doesn’t explain how --why will help to find a reason of bloated JS bundle.

I also created and issue in Statoscope repo since we can improve demo screenshot there as well https://github.com/statoscope/statoscope/issues/124

ai commented 2 years ago

Thanks. Released in 6.0.

smelukov commented 2 years ago

@ai thank you! As you said at your performance, now I can tell that Statoscope is using by size-limit 🤣

ai commented 2 years ago

Now I can tell that Statoscope is using by size-limit

Absolutly!

ai commented 2 years ago

Can you try to check that npx size-limit --why works?

I tried on nanostores/persistent and got 404 in the browser, because Size Limit removed temporary file.

smelukov commented 2 years ago

I'm without my laptop now, but if size-limit removes build directory then we can use os tmp directory to save statoscope report 🤔

ai commented 2 years ago

We may need to keep size-limit running until user will close it explicitly by Ctrl+C (we will need print note about it on --why call).

Or we can save HTML file in current dir.

smelukov commented 2 years ago

Maybe we can save statoscope report into os tmp directory by default. But add the possibility to save the report in another place npx size-limit --why --save-report path/to/report.html

ai commented 2 years ago

Sure. Just be sure that report in OS tmp for will not be deleted (we can use another dir for the report)

smelukov commented 2 years ago

https://github.com/ai/size-limit/pull/259 here is the fix