mirror of
https://github.com/tuanngocptn/nport.git
synced 2026-04-26 05:35:48 +03:00
[PR #11] [MERGED] Optimize CLI bundle size with esbuild #9
Labels
No labels
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nport#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/tuanngocptn/nport/pull/11
Author: @tuanngocptn
Created: 1/27/2026
Status: ✅ Merged
Merged: 1/27/2026
Merged by: @tuanngocptn
Base:
main← Head:feat/optimize_size📝 Commits (4)
487044cUpdate build process and dependencies for NPort CLIad7b63fEnhance build script for watch mode in NPort CLI6ccc86dUpdate GitHub Actions test-smoke workflow for NPort58bfa00Release v2.1.2 - Optimize build process and enhance testing📊 Changes
7 files changed (+799 additions, -128 deletions)
View changed files
📝
.github/workflows/test-smoke.yml(+33 -10)📝
CHANGELOG.md(+57 -0)📝
package-lock.json(+573 -106)📝
package.json(+7 -6)➕
scripts/build.js(+123 -0)📝
src/index.ts(+1 -2)📝
tsconfig.json(+5 -4)📄 Description
Summary
tscwithesbuildfor bundling, enabling minification, tree-shaking, and single-file outputpostinstall.jsscript, removedCHANGELOG.md)Changes
Build System
scripts/build.jsusing esbuild to bundle the CLIsrc/index.ts→dist/index.js) and bin-manager separatelyaxios,chalk,ora) kept external to avoid CJS/ESM issuesPackage Optimization
filesinpackage.jsonto only include necessary filesdeclarationandsourceMapintsconfig.jsonnoEmit: trueto tsconfig (esbuild handles output)CI/CD
Test Plan
npm run buildand verify output size reductionnpm run devand verify watch mode worksnpm testto ensure no regressionsnpm packand inspect tarball contents🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.