Development Mode
Starting the Dev Server
bash
npm run devThis runs acodez dev which does the following in parallel:
- Starts the Esbuild watcher — instantly recompiles on every file save
- Starts an HTTP server on
http://127.0.0.1:3000servingplugin.zip - Starts a WebSocket server on
ws://127.0.0.1:3001for HMR signals - Pipes Console Logs — Automatically hooks
console.log,console.warn, andconsole.errorin the Acode app and pipes them wirelessly back into your PC terminal!
Inline Source Maps
Development builds automatically inject inline source maps into the compiled output.
This means when your plugin crashes inside Acode's WebView, instead of seeing:
TypeError: Cannot read property 'x' of undefined
at t.<anonymous> (main.js:1:4521)You see the exact TypeScript file and line number:
TypeError: Cannot read property 'x' of undefined
at AcodePlugin.init (src/index.ts:24:18)How to see source maps in Acode
Acode ships with an Eruda developer console. Tap the floating debug button to open it and view the full stack trace with source-mapped locations.
File Watch Behavior
| Change | Action |
|---|---|
.ts file saved | TypeScript recompiled → plugin.zip updated → HMR signal sent |
.scss file saved | SASS compiled to string → TypeScript recompiled → HMR signal sent |
plugin.json changed | Manifest updated in zip → HMR signal sent |
icon.png changed | Icon re-processed → zip updated |
HMR Reload Flow
You save index.ts
↓
Esbuild detects change (< 1ms)
↓
TypeScript + SASS compiled (< 30ms)
↓
plugin.zip rebuilt in memory
↓
WebSocket broadcasts "reload" to Acode
↓
Acode re-fetches plugin.zip from HTTP server
↓
Plugin restarts inside Acode WebViewTotal time from save to running: < 500ms