Skip to content
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

Esbuild plugin produces incorrect numbers when CSS used #360

Closed
just-boris opened this issue Mar 20, 2024 · 7 comments · Fixed by #361
Closed

Esbuild plugin produces incorrect numbers when CSS used #360

just-boris opened this issue Mar 20, 2024 · 7 comments · Fixed by #361

Comments

@just-boris
Copy link
Contributor

just-boris commented Mar 20, 2024

If a project contains a CSS file in imports, for example import "./styles.css";, size-limit with esbuild plugin only counts CSS size and skips Javascript. The same works well on webpack + webpack-css plugin.

Reproducible in this sample project: https://github.com/just-boris/size-limit-demos

The same entry produces different results when using esbuild and webpack plugins

@ai
Copy link
Owner

ai commented Mar 20, 2024

Should we suggest using webpack or there is a simple way to fix esbuild?

@just-boris
Copy link
Contributor Author

Found a simple way: #361

@ai ai closed this as completed in #361 Mar 21, 2024
@ai
Copy link
Owner

ai commented Mar 22, 2024

The fix was released in 11.1.2.

@just-boris
Copy link
Contributor Author

Thanks, got the expected numbers now.

I think the issue is a big one. All people using @size-limit/preset-small-lib with CSS files are affected and have inaccurate numbers.

How about sending a PSA to the users?

@ai
Copy link
Owner

ai commented Mar 22, 2024

What is PSA in this context?

@just-boris
Copy link
Contributor Author

Public service announcement. Something like this: https://twitter.com/justboriss/status/1771153391072292969

@ai
Copy link
Owner

ai commented Mar 22, 2024

I retweeted your tweet :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants