serverless-esbuild icon indicating copy to clipboard operation
serverless-esbuild copied to clipboard

Rewrite Module Packaging Logic

Open samchungy opened this issue 2 years ago • 5 comments
trafficstars

Is your feature request related to a problem? Please describe.

Hello! I'm back for business.

  1. The current logic with packaging modules is very complicated. I would know as I wrote most of it 😪 Having looked through some of the CDK esbuild logic I like what they've done and instead of trying to determine what modules to package based on npm ls or yarn list they instead simply create a fake package.json and run the equivalent install command. This should make supporting newer and future bundlers simpler.

  2. I would like to add per function external and exclude logic. I think excluding deps because we can't detect them being used in a function is error prone so we should instead encourage users to use per function excludes if they choose to package individually.

  3. Add support for pnpm.

Describe the solution you'd like A clear and concise description of what you want to happen.

Described as above

Describe alternatives you've considered N/A

Additional context Add any other context or screenshots about the feature request here.

samchungy avatar Nov 17 '23 12:11 samchungy

I'd also like to improve lifecycle hooks, add new hooks like before/after bundle, before/after package, etc.

for ref: https://github.com/floydspace/serverless-esbuild/issues/158

floydspace avatar Nov 17 '23 14:11 floydspace

it could be a valuable step toward the serverless-esbuild v2

floydspace avatar Nov 17 '23 14:11 floydspace

I'll look to raise some PRs just shortly after the new years, in case someone is wondering.

samchungy avatar Dec 22 '23 04:12 samchungy