Skip to content

Avoid bundling TypeScript in the production CLI - #8248

Merged
isaacroldan merged 2 commits into
mainfrom
isaac/externalize-typescript-from-cli-bundle
Aug 4, 2026
Merged

Avoid bundling TypeScript in the production CLI#8248
isaacroldan merged 2 commits into
mainfrom
isaac/externalize-typescript-from-cli-bundle

Conversation

@isaacroldan

@isaacroldan isaacroldan commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Why

Oclif has an optional TypeScript loader for development and linked source plugins. Esbuild follows that reference and adds the TypeScript compiler to both production bundles, although production commands use compiled JavaScript and skip the loader.

What

Keep TypeScript external to the Shopify CLI and create-app bundles. Development can resolve the repository dev dependency. Packaged CLIs without TypeScript use the Oclif compiled-source fallback.

This reduces the Shopify CLI static bootstrap JavaScript from about 4.0 MB to 391 KB. It also reduces the create-app JavaScript bundle from 33.42 MB to 24.36 MB.

Validation

  • pnpm nx bundle cli --skip-nx-cache
  • pnpm nx bundle create-app --skip-nx-cache
  • Prettier checks for both bundle files
  • Development-mode help and version commands
  • Production-style packages without TypeScript: Shopify CLI version, help, and app dev help; create-app help

@isaacroldan
isaacroldan requested a review from a team as a code owner August 4, 2026 10:36
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Aug 4, 2026
@isaacroldan

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260804105319

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@isaacroldan
isaacroldan added this pull request to the merge queue Aug 4, 2026
Merged via the queue into main with commit c6bad98 Aug 4, 2026
29 checks passed
@isaacroldan
isaacroldan deleted the isaac/externalize-typescript-from-cli-bundle branch August 4, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants