From 80ee438ebd321fc5c0651ccc60782353256a894d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E9=81=93=E6=BA=90?= Date: Thu, 2 Jun 2022 17:08:26 +0800 Subject: [PATCH 1/4] fix: show wrong size after building success --- src/builder/rollup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builder/rollup.ts b/src/builder/rollup.ts index 5c9a75b..73e1204 100644 --- a/src/builder/rollup.ts +++ b/src/builder/rollup.ts @@ -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: entry.code.length, exports: entry.exports }) } From e67d40578005dac8f7d5aa2b8e8dd0a55b10451e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E9=81=93=E6=BA=90?= Date: Thu, 2 Jun 2022 17:13:13 +0800 Subject: [PATCH 2/4] style: warning fixed eslint warning for `import/no-named-as-default` --- src/build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.ts b/src/build.ts index fd180e1..a33123e 100644 --- a/src/build.ts +++ b/src/build.ts @@ -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' From 1632c4738b88d9cdf9b47fe2db7695f42cfd3904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E9=81=93=E6=BA=90?= Date: Thu, 2 Jun 2022 17:20:26 +0800 Subject: [PATCH 3/4] chore: command line arguments fixed after pnpm v7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f5e58fc..ad51803 100644 --- a/package.json +++ b/package.json @@ -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" }, From 3d5847b5ed847e1a8c738c5b6bc8532ec4c02938 Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Wed, 22 Jun 2022 13:19:08 +0200 Subject: [PATCH 4/4] Update src/builder/rollup.ts --- src/builder/rollup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builder/rollup.ts b/src/builder/rollup.ts index 73e1204..7cb91d7 100644 --- a/src/builder/rollup.ts +++ b/src/builder/rollup.ts @@ -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, + bytes: Buffer.byteLength(entry.code, 'utf8'), exports: entry.exports }) }