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

Esbuild plugin #270

Closed Toomean closed 2 years ago

Toomean commented 2 years ago

Hello there! I've worked on a plugin for esbuild( according to #267 ). Not sure about the needed requirements and the final point for this

Take a look, please

ai commented 2 years ago

Looks excellent. We just need also check.import support to test libraries with tree-shaking.

Search for check.import and import in the project and you will find a code in webpack plugin (and config validation in size-limit) which you will need to back port (copy-pasting is OK, but if it will be possible to move some helpers to size-limit and then re-use it, it will better).

ai commented 2 years ago

We still need to fix coverage and fix some strange Node.js 12 issue

ai commented 2 years ago

Test coverage shows that we need to calibrate (test) ESBUILD_EMPTY_PROJECT_IMPORT and ESBUILD_EMPTY_PROJECT_IMPORT_GZIP.

Also, we still have Node.js 12 problem:

> error: Could not resolve "/home/runner/work/size-limit/size-limit/packages/esbuild/test/fixtures/unknown.js"

 > error: Refusing to overwrite input file "../../../../../tmp/size-limit-qzG5j_Arw23-2HlwpuSXJ/index.js" (use "allowOverwrite: true" to allow this)

 > error: Refusing to overwrite input file "../../../../../tmp/size-limit-8Rz_8m1YKc_k-mX_IJzsY/index.js" (use "allowOverwrite: true" to allow this)
Toomean commented 2 years ago

Can't reproduce errors from actions on my local machine, will investigate it on another os. As I see, this problem appears on every node version

ai commented 2 years ago

Can't reproduce errors from actions on my local machine

It could be related to CI environment also

ai commented 2 years ago

I pushed merge commit to run CI

ai commented 2 years ago

Greta work. Thanks.