Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: properly calculate bytes of output size#82

Merged
pi0 merged 4 commits into
unjs:mainfrom
tangdaoyuan:fix-build-size
Jun 22, 2022
Merged

fix: properly calculate bytes of output size#82
pi0 merged 4 commits into
unjs:mainfrom
tangdaoyuan:fix-build-size

Conversation

@tangdaoyuan
Copy link
Copy Markdown
Contributor

#81

@chrisbbreuer
Copy link
Copy Markdown
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? 🙂

Comment thread src/builder/rollup.ts Outdated
@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
Copy Markdown
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