iamkun / iamkun/dayjs

Question about bundled size vs advertised size

Open
#2,807 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
it's not a bug but more like discussion, I don't see discussions enabled on github so opening here.

I was doing some testing with dayjs, when I observed that the bundle size dayjs advertises is 2kb. But in my testing, I could not get it to 2kb no matter what.

My code:

```js

const dateStr = "2024-03-15";
const parsedDate = dayjs(dateStr);
console.log("Parsed date:", parsedDate.toDate());
```

after bundle and checking with bundle analyzer I got:

![image](https://github.com/user-attachments/assets/658fa23c-c5fb-430d-bd90-611361a26b0f)

So is the advertised part "2kb" is after gzipping? Anyway that's coming as 3+kb in my testing
and 7kb before gzipping. It's still pretty small, but just wanted to know if the 2kb part is still valid or am I missing anything

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.