-
-
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
Error checking package import bundle size for node packages with size-limit-preset-node-lib #306
Comments
It is expected behavior. Why it doesn’t work for you? |
Because the package I'm checking bundle size is developed to be used in node projects only, and I'm interested in what the actual bundle size for node project not supporting |
In my world, there is no such thing as bundle size for Node.js project since you do not need bundlers for Node.js. What do you mean for “bundle” in Node.js and why do you care about it’s size? |
Our backend is build on top of AWS lambda, which have size limit of 50mb. |
Interesting problem :-/ Seems like you need to set custom esbuild config with a target to Node.js https://esbuild.github.io/api/#target It will disable auto-polyfills. Try to use |
I have tried to implement this tool in our monorepo containing only node specific packages or both browser/node compatible.
I'm facing issues using
@size-limit/preset-small-lib
preset of a node library, which is using node-fetch package. After running check the bundle was surprisingly small. After investigation I have figured out that wholenode-fetch
package was replace with some small esbuild global.fetch polyfill. That probably because it was build for web, not node platform.So I have switched preset to https://github.com/un-ts/size-limit/tree/main/packages/preset-node-lib and try to run bundle check with it. But it refuses to working with
import
option. I have also tried to change the CLI--save-bundler
option to check the output withoutimport
option, but it had the same error, so its impossible to properly check the bundle size for node packages.The text was updated successfully, but these errors were encountered: