feat: Leverage esbuild CLI commands
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 337
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
Thank you for this very underrated project.
Is your feature request related to a problem? Please describe
The main motivation for this issue is the same as #45, but I have more points to bring to the table.
I use the bundled version of Lit. I import that file in every Lit component I have, and packup build ends up adding the entire Lit bundle to every component.
Describe the solution you'd like
I'd like Packup to have an option to just transpile TS, without bundling. That would solve the problem for me.
Describe alternatives you've considered
Since esbuild supports transpiling without bundling, could Packup leverage esbuild commands? I was wondering if Packup could just forward to esbuild whatever commands Packup receives via CLI.
By doing that, we would automatically give the user the option to minify, mangle, add a footer, limit line length, tweak path resolution and everything else that esbuilds supports. Whenever esbuild adds a new feature, it could be easily added to Packup as well, and the docs would always be up to date because the user could refer to esbuild's docs.
So packup build would be become packup build --bundle (because esbuild takes the --bundle arg). And immediately we would support esbuild flags like --minify, --keep-names, --mangle-props, --minify-whitespace and others. Same thing for packup serve.
Caveats
- I guess not all esbuild flags will work OOTB (e.g. code splitting). We could intercept those flags and inform the user that they are not supported yet.
- Packup's own CLI args would be mixed with esbuild's args, which means they probably shouldn't have the same names. We could prefix Packup's args to avoid naming collisions with esbuild.
Let me know if you like the idea 👍.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names the packup build and packup serve CLI commands and proposes forwarding esbuild flags. Start by tracing those command entry points and how Packup currently handles its own options; no files or tests are named. Done means transpile-only operation and supported esbuild options work without collisions, with unsupported flags clearly reported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- deno, typescript
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100