-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add esbuild-why plugin #304
Conversation
Seems like the |
I am on vacation and will review it a little later |
Sure, enjoy your vacation! 🍹 |
packages/esbuild-why/index.js
Outdated
async step81(config, check) { | ||
if (config.why && check.esbuildMetafile) { | ||
if (!config.saveBundle) { | ||
console.warn('`--why` option requires `--save-bundle` option') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a test for this line
Welcome back! I'll need to do some update to this PR, like updating the dependency as now the function is properly exposed, and other things. btw, is the |
There is no system. And since there is not a lot of plugins, just put it between necessary steps. |
Can we improve test coverage to fix CI? |
Sure, but right now I'm trying to see how to use it locally. i.e. how to set the I'll try to do a In the doc, it mention about the config for webpack but not the config for esbuild. And maybe that's also something to improve upon. |
|
thx. I tried that but don't know if I'm doing it correctly. I have added this in {
"name": "esbuild-why",
"private": true,
"devDependencies": {
"@size-limit/esbuild-why": ">= 0.0.0",
"@size-limit/file": ">= 0.0.0",
"size-limit": ">= 0.0.0"
},
"size-limit": [
{
"path": "index.js"
}
]
} with an empty
I can't find where should I do this. From the path, seems like you are referring to calling I'll find some time to work on this PR this week. btw, I always get this timeout error when running the tests. I'm using WSL in Windows: packages/time/test/get-running-time.test.js (15.731 s)
● calculates running time
thrown: "Exceeded timeout of 15000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
15 | })
16 |
> 17 | it('calculates running time', async () => {
| ^
18 | let runTime = await getRunningTime(EXAMPLE)
19 | expect(runTime).toBeGreaterThan(0.01)
20 | expect(runTime).toBeLessThan(0.5)
at Object.it (packages/time/test/get-running-time.test.js:17:1) |
You should be in the fixture folder and call: $ cd
size-limit/fixtures/integration
$ ../../packages/size-limit/bin.js
✔ Adding to empty webpack project
✔ Running JS in headless Chrome
Package size is 58 B less than limit
Size limit: 200 B
Size: 142 B with all dependencies, minified and gzipped
Loading time: 10 ms on slow 3G
Running time: 84 ms on Snapdragon 410
Total time: 94 ms |
I don’t have a Windows to investigate the reason without your help. But let’s ignore this test until we will not finish this PR. |
Sure, I'm ignoring that. :) |
to use the exported `visualizer` instead of deep linking
Hi @ai, sorry for the long wait. I have updated the code a bit to better handle the error message. I have tested it and it will create a |
remove not used test code
Nice. I fixed CI. Will review PR tomorrow (need to run to a party) |
Thanks! Released in 8.2. |
🎉 |
fixes #302