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.56k stars 1.82k forks source link

Running without installation #243

Closed telamon closed 3 years ago

telamon commented 3 years ago

hey when i attempt to run:

npx size-limit

inside of my module i'm met with an error of installing some profile dependencies... I'm not too keen on trashing down a lib with more deps just to check it's size, kinda counterproductive... So i guess either the stand-alone cli functionality should either be repaired or the image in the readme removed? Thanks! :+1:

ai commented 3 years ago

You must add Size Limit to package.json first to run npx size-limit because of the way how we look for Size Limit plugins.

There is no way to do it from npx size-limit without installing dependencies.

It should be something like:

npm install size-limit
npm install @size-limit/file # or any other plugin
npx size-limit # and now you can run Size Limit because `npm install` added it to package.json
telamon commented 3 years ago

Sorry to hear that, let me know if you decide to redesign this util. :+1: