Skip to content

zhy0216/browser-run

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

browser-run

Bundle and run real TypeScript + React in the browser — no server, no native binaries.

Built on:

  • almostnode — Node.js-flavored runtime in the browser (VFS, npm package manager, service worker).
  • @rollup/browser — Rollup's official browser build.
  • esbuild-wasm — WASM build for TSX/JSX transformation.

Structure

browser-run/
├── packages/
│   ├── almostnode/      # Node-like runtime (copied from libs/almostnode)
│   └── rollup-vfs/      # @rollup/browser + VFS bridge plugins
└── apps/
    └── demo/            # React + Tailwind + TS todo app, bundled in the browser

Getting started

pnpm install
pnpm dev          # opens the demo at http://localhost:5173
pnpm test:e2e     # runs Playwright E2E suite

How the demo works

  1. The host page (apps/demo) loads almostnode and creates an in-memory VFS.
  2. The user's TypeScript source files are written into the VFS.
  3. @rollup/browser runs in the same page, using packages/rollup-vfs plugins that read from the VFS and transform .tsx through esbuild-wasm.
  4. The resulting bundle is wrapped in HTML (with Tailwind via CDN) and loaded into an <iframe> via a Blob URL.

No build server, no native code — the whole pipeline runs client-side.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages