Skip to content

API > wxt > WxtBuilderServer

Interface: WxtBuilderServer

Contents

Properties

watcher

watcher: FSWatcher

Chokidar file watcher instance.

Source

packages/wxt/src/types.ts:1100


ws

ws: object

The web socket server used to communicate with the extension.

Type declaration

on()

Listen for messages over the server's websocket.

Parameters

message: string

cb: (payload) => void

send()

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

Parameters

message: string

payload?: any

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

Source

packages/wxt/src/types.ts:1083

Methods

close()

close(): Promise<void>

Stop the server.

Source

packages/wxt/src/types.ts:1071


listen()

listen(): Promise<void>

Start the server.

Source

packages/wxt/src/types.ts:1067


transformHtml()

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

Transform the HTML for dev mode.

Parameters

url: string

html: string

originalUrl?: string

Source

packages/wxt/src/types.ts:1075


Generated using typedoc-plugin-markdown and TypeDoc