Skip to content

feat(cli): support --external with deno compile --bundle - #37137

Open
jipeng6036-del wants to merge 1 commit into
denoland:mainfrom
jipeng6036-del:fix/compile-bundle-external-pr6
Open

jipeng6036-del wants to merge 1 commit into
denoland:mainfrom
jipeng6036-del:fix/compile-bundle-external-pr6

Conversation

@jipeng6036-del

Copy link
Copy Markdown

Related to #37126.

deno compile --bundle can fail on an optional dependency before the program starts. Add a repeatable --external <specifier> option so compile uses the same matcher as deno bundle, including for worker bundles. Keep native addons and the npm packages still imported by the bundle available in the standalone executable.

On Linux, the reporter's Playwright example compiles and prints function with:

deno compile --bundle --external=npm:playwright-core@1.64.1 --allow-all --output app main.ts
./app

Externalizing only chromium-bidi/* lets the build finish, but the inlined Playwright code still reaches its existing CommonJS __dirname error. The guarded node:sea example compiles and prints not a SEA with --external=node:sea.

Validation: 387 CLI parser tests, 11 compile bundle specs, Linux builds of deno and denort, repository format check, and the Rust and JavaScript lint checks. The standalone smoke tests ran the generated executables on Linux.

AI disclosure: OpenAI Codex assisted with implementation, testing, and drafting this description.

@CLAassistant

CLAassistant commented Nov 8, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
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