Features
- One command: starts the local web server, opens the browser and runs the TypeScript watch build.
- Free port: tries port 53000 first and looks for a free one if it is in use.
- No 404 on launch: compiles once before the browser opens.
- Hot reload: reloads the browser when files in
src/orindex.htmlchange. - Clean exit:
Ctrl + Cstops the background Bun server. - Update check: shows a notice when a newer version exists.
Quick start
You need Python 3.9+ and Bun. Install with pnpm (recommended) or pip:
pnpm add -g @lapius/tsbuild
# or
pip install tsbuild
[!NOTE] The npm package is built for pnpm. Do not install it with both npm and pnpm, or the same command exists twice. The npm package is a launcher that runs the Python tool, so it also needs Node.js 18 or later.
Run it in the project root, the folder that holds package.json and server.ts:
tssetup my-app # create a project (see tssetup)
tsbuild # start the dev server
Outside a project, tsbuild prints the version and an info screen.
| Tool | Used for | Install |
|---|---|---|
| Python 3.9+ | Running tsbuild | python.org |
| Bun | Dev server and TypeScript compile | powershell -c "irm bun.sh/install.ps1 | iex" |
Options
| Option | Short | What it does |
|---|---|---|
--port <num> | -p | Starting port (default 53000) |
--no-browser | -n | Do not open the browser |
--update | -u | Update to the latest version, using the way it was installed |
--lang <lang> | Display language: ja or en | |
--version | -v | Show the version |
--help | -h | Show help |
How it works
- Find a port: searches for a free port from 53000.
- First build: runs
bun x tsconce so the JS exists before the browser opens. - Open the browser: opens
http://localhost:53000, or the port it found. - Watch:
bun x tsc --watchrecompiles on every change. - Hot reload: tells the browser to reload over WebSocket after each build.
Expected project layout
tsbuild expects the layout that tssetup creates:
my-app/
├── src/
│ └── index.ts ← TypeScript you edit
├── dist/ ← JS output from tsc
├── index.html ← frontend HTML
├── server.ts ← Bun server started by tsbuild
├── tsconfig.json ← TypeScript config
└── package.json ← Bun project config
Update
tsbuild --update
Or reinstall: pnpm add -g @lapius/tsbuild / pip install --upgrade tsbuild.
Safety
[!NOTE] The README and PyPI metadata say Windows (PowerShell, CMD, Windows Terminal). Linux and macOS have not been verified for this README.
The software is provided as is, and the author takes no responsibility for any damage from using it.
Contact
License
MIT © 2026 Lapius7