refactor: bundle xterm.js with esbuild instead of CDN runtime loading#8
Open
yuezanhao wants to merge 1 commit intocloudcli-ai:mainfrom
Open
refactor: bundle xterm.js with esbuild instead of CDN runtime loading#8yuezanhao wants to merge 1 commit intocloudcli-ai:mainfrom
yuezanhao wants to merge 1 commit intocloudcli-ai:mainfrom
Conversation
Switch from loading xterm.js modules dynamically from esm.sh CDN at runtime to bundling them with esbuild at build time. This eliminates runtime CDN dependency, improves load reliability, and enables offline usage. Key changes: - Add @xterm/* npm packages as direct dependencies - Replace dynamic CDN imports with static ES module imports - Use esbuild to bundle JS and inline CSS - Add tsconfig.server.json for server-side compilation - Remove XtermModules interface and loadModules() helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@xterm/*packages as npm dependencies instead of loading from CDN at runtimetsconfig.server.jsonfor server-side TypeScript compilationXtermModulesinterface andloadModules()helper (no longer needed)Why
Runtime CDN loading introduces several issues:
Bundling at build time resolves all of these while keeping the same runtime behavior.
Test plan
npm installcompletes successfullynpm run buildproducesdist/index.jswith bundled xterm🤖 Generated with Claude Code