Skip to content

API / wxt / WxtBuilderServer

Interface: WxtBuilderServer ​

Source: packages/wxt/src/types.ts:1279

Contents ​

Properties ​

watcher ​

watcher: FSWatcher

Source: packages/wxt/src/types.ts:1304

Chokidar file watcher instance.


ws ​

ws: object

Source: packages/wxt/src/types.ts:1291

The web socket server used to communicate with the extension.

on() ​

on(message, cb): void

Listen for messages over the server's websocket.

Parameters ​
message ​

string

cb ​

(payload) => void

Returns ​

void

send() ​

send(message, payload?): void

Send a message via the server's websocket, with an optional payload.

Parameters ​
message ​

string

payload? ​

any

Returns ​

void

Example ​
ts
ws.send("wxt:reload-extension");
  ws.send("wxt:reload-content-script", { ... });

Methods ​

close() ​

close(): Promise<void>

Source: packages/wxt/src/types.ts:1283

Stop the server.

Returns ​

Promise<void>


listen() ​

listen(): Promise<void>

Source: packages/wxt/src/types.ts:1281

Start the server.

Returns ​

Promise<void>


on()? ​

optional on(event, callback): void

Source: packages/wxt/src/types.ts:1305

Parameters ​

event ​

string

callback ​

() => void

Returns ​

void


transformHtml() ​

transformHtml(url, html, originalUrl?): Promise<string>

Source: packages/wxt/src/types.ts:1285

Transform the HTML for dev mode.

Parameters ​

url ​

string

html ​

string

originalUrl? ​

string

Returns ​

Promise<string>


Generated using typedoc-plugin-markdown and TypeDoc