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

fix: properly calculate bytes of output size #82

Merged
merged 4 commits into from
Jun 22, 2022

Conversation

tangdaoyuan
Copy link
Contributor

#81

@chrisbbreuer
Copy link
Contributor

chrisbbreuer commented Jun 22, 2022

I realized this issue as well and then when I briefly skimmed the web to figure out what could cause a "times 4" conversion, I couldn't find the reason haha curious to know if you mind sharing? 🙂

src/builder/rollup.ts Outdated Show resolved Hide resolved
@pi0 pi0 changed the title fix: show wrong size after building success fix: properly calculate bytes of output size Jun 22, 2022
@pi0
Copy link
Member

pi0 commented Jun 22, 2022

Thanks for the PR @tangdaoyuan. I've updated your change to use Buffer.byteLength(str, 'utf8') since due to dynamic length of utf-8 encoding, one character might generate a variable file size.

@pi0 pi0 merged commit 1888978 into unjs:main Jun 22, 2022
@renovate renovate bot mentioned this pull request May 12, 2023
1 task
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 this pull request may close these issues.

3 participants