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

support TypeScript #286

Closed unional closed 2 years ago

unional commented 2 years ago

In TypeScript, one of the questions I always have is whether to use the importHelpers flag.

Should I use it depends on the project. If the project is big, then using importHelpers will reduce the size of the package.

However the threshold is unknown and it is difficult to test.

If size-limit can support TypeScript directly, when we can easily test it:

{
  "size-limit": [
    { "type": "typescript", "path": "./src/index.ts", "tsconfigPath": "tsconfig.withoutHelper.json", "limit": "10kB" },
    { "type": "typescript", "path": "./src/index.ts", "tsconfigPath": "tsconfig.withHelper.json", "limit": "10kB" }
  ]
}