Skip to content

Development Mode ​

Starting the Dev Server ​

bash
npm run dev

This runs acodez dev which does the following in parallel:

  1. Starts the Esbuild watcher — instantly recompiles on every file save
  2. Starts an HTTP server on http://127.0.0.1:3000 serving plugin.zip
  3. Starts a WebSocket server on ws://127.0.0.1:3001 for HMR signals
  4. Pipes Console Logs — Automatically hooks console.log, console.warn, and console.error in 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 ​

ChangeAction
.ts file savedTypeScript recompiled → plugin.zip updated → HMR signal sent
.scss file savedSASS compiled to string → TypeScript recompiled → HMR signal sent
plugin.json changedManifest updated in zip → HMR signal sent
icon.png changedIcon 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 WebView

Total time from save to running: < 500ms

Built with precision by Rugved.