Skip to content

Handle Serverless esbuild inject entries - #1865

Merged
webpro merged 2 commits into
webpro-nl:mainfrom
jakeleventhal:codex/serverless-esbuild-inject-entries
Jul 7, 2026
Merged

Handle Serverless esbuild inject entries#1865
webpro merged 2 commits into
webpro-nl:mainfrom
jakeleventhal:codex/serverless-esbuild-inject-entries

Conversation

@jakeleventhal

@jakeleventhal jakeleventhal commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add Serverless Framework plugin entries for esbuild inject files from custom.esbuild and build.esbuild
  • keep the existing optional esbuild dependency detection
  • extend the TypeScript Serverless fixture to cover injected files

Validation

  • node --test packages/knip/test/plugins/serverless-framework.test.ts
  • corepack pnpm --dir packages/knip build
  • corepack pnpm --dir packages/knip lint

@jakeleventhal jakeleventhal changed the title [codex] Handle Serverless esbuild inject entries Handle Serverless esbuild inject entries Jul 5, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/knip@1865
npm i https://pkg.pr.new/@knip/language-server@1865
npm i https://pkg.pr.new/@knip/mcp@1865

commit: 6b6bf7b

@jakeleventhal
jakeleventhal marked this pull request as ready for review July 5, 2026 17:54

@webpro webpro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request! Happy top merge, just one nit.


export type EsbuildConfig =
| {
inject?: string | string[];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: inject is string[] not string (and does require arrayify)

@jakeleventhal jakeleventhal Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done by changing the Serverless esbuild config type so inject is modeled as string[], while keeping arrayify in the resolver for runtime normalization: 6b6bf7b

@webpro ready for another look.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to drop the arrayify if you prefer

@jakeleventhal
jakeleventhal requested a review from webpro July 6, 2026 22:04
@webpro
webpro merged commit 46111ef into webpro-nl:main Jul 7, 2026
30 checks passed
@webpro

webpro commented Jul 7, 2026

Copy link
Copy Markdown
Member

Thanks Jake!

@webpro

webpro commented Jul 7, 2026

Copy link
Copy Markdown
Member

🚀 This pull request is included in v6.25.0. See Release 6.25.0 for release notes.

Using Knip in a commercial project? Please consider becoming a sponsor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants