ai / ai/size-limit

Error checking package import bundle size for node packages with size-limit-preset-node-lib

未關閉
#306 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
6.9k
分支
1.8k
平均合併
44 分鐘
30 天內合併 PR
1

描述

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 whole `node-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 without `import` option, but it had the same error, so its impossible to properly check the bundle size for node packages.

CleanShot 2022-12-13 at 18 16 01@2x
CleanShot 2022-12-13 at 18 16 59@2x

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。