Skip to content

Bundle xterm.js locally for offline support#225

Open
woltspace-jerpint[bot] wants to merge 1 commit intomainfrom
uxw/bundle-xterm
Open

Bundle xterm.js locally for offline support#225
woltspace-jerpint[bot] wants to merge 1 commit intomainfrom
uxw/bundle-xterm

Conversation

@woltspace-jerpint
Copy link
Contributor

Summary

  • Replace jsdelivr CDN imports in split.html with locally bundled xterm.js (~287kb ESM bundle)
  • Terminal now works fully offline on localhost — no CDN dependency
  • Also fixes _serve_platform_file() to serve non-HTML files (CSS, JS, MJS) with correct MIME types

Changes

  • public/vendor/xterm/xterm-all.mjs — bundled ESM (Terminal + FitAddon + WebLinksAddon)
  • public/vendor/xterm/xterm.css — local copy of xterm CSS
  • public/split.html — imports from /vendor/xterm/ instead of jsdelivr
  • server/app.py_serve_platform_file now handles non-HTML MIME types
  • server/config.py — added .mjs to MIME_TYPES
  • package.json — xterm packages added as dependencies + build:xterm script for regeneration

Test plan

  • Open split.html in browser — terminal should render and connect
  • Disconnect internet / block jsdelivr — terminal still works
  • Check xterm CSS loads (dark background, proper font rendering)
  • Verify livereload, viewport, and all other split.html features still work

🤖 Generated with Claude Code

Replace jsdelivr CDN imports with locally bundled xterm.js (287kb).
split.html now loads from /vendor/xterm/ — works without internet.

Also fixes _serve_platform_file to handle non-HTML files with correct
MIME types, and adds .mjs to MIME_TYPES.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
woltspace Ready Ready Preview, Comment Mar 22, 2026 2:05pm

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.

0 participants