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

Size limit ignoring aliases #268

Closed The-Code-Monkey closed 2 years ago

The-Code-Monkey commented 2 years ago

So on my components repo size limit seems to be ignoring the aliased values that I have setup in my project. How do I resolve this

ai commented 2 years ago

Sorry, I do not understand the question.

What is aliased values? Can you give me more important about your project? Also, Size Limit config, plugins list, and output can be helpful.

The-Code-Monkey commented 2 years ago

Sorry yeah I have some aliased imports in my typescript repo that are defined and picked up via the tsconfig file but size limit seems to ignore these. How do I get it to pick them up

ai commented 2 years ago

It is still not helpful.

Can you show:

  1. Code example of these imports
  2. Current Size Limit config and output if you use it
The-Code-Monkey commented 2 years ago

So i added webpack: false to my size limit config and it seems to fix the issue that i was having not sure why though.

https://github.com/The-Code-Monkey/Components

This is my repo if you want to take a look and see what the issue was.

ai commented 2 years ago

@size-limit/preset-small-lib plugin was created for projects, which do not bundle JS files (you do not need bundling for open source libraries).

If you are creating application (or bundle files for another reason) you should replace @size-limit/preset-small-lib to @size-limit/file.