Skip to content

Commit

Permalink
fix: properly calculate bytes of output size (#82)
Browse files Browse the repository at this point in the history
Co-authored-by: pooya parsa <pyapar@gmail.com>
  • Loading branch information
tangdaoyuan and pi0 authored Jun 22, 2022
1 parent 2831b36 commit 1888978
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"lint": "eslint --ext .ts,.js .",
"prepack": "pnpm unbuild",
"release": "pnpm test && standard-version && git push --follow-tags && npm publish",
"stub": "pnpm unbuild -- --stub",
"stub": "pnpm unbuild --stub",
"test": "mocha -r jiti/register ./test/*.test.*",
"unbuild": "jiti ./src/cli"
},
Expand Down
2 changes: 1 addition & 1 deletion src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { resolve, basename } from 'pathe'
import type { PackageJson } from 'pkg-types'
import chalk from 'chalk'
import consola from 'consola'
import defu from 'defu'
import { defu } from 'defu'
import { createHooks } from 'hookable'
import prettyBytes from 'pretty-bytes'
import mkdirp from 'mkdirp'
Expand Down
2 changes: 1 addition & 1 deletion src/builder/rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export async function rollupBuild (ctx: BuildContext) {
if (entry.isEntry) {
ctx.buildEntries.push({
path: relative(ctx.options.rootDir, resolve(outputOptions.dir!, entry.fileName)),
bytes: entry.code.length * 4,
bytes: Buffer.byteLength(entry.code, 'utf8'),
exports: entry.exports
})
}
Expand Down

0 comments on commit 1888978

Please sign in to comment.