gro_plugin_deno_server.ts

Gro plugin for running a Deno server alongside the Vite dev server.

Unlike gro_plugin_server, this doesn't use esbuild bundling since Deno can run TypeScript directly with JSR imports.

Declarations
#

2 declarations

view source

gro_plugin_deno_server
#

gro_plugin_deno_server.ts view source

(options?: GroPluginDenoServerOptions): Plugin<PluginContext<object>>

Creates a gro plugin that runs a Deno server during development. The server is started during setup and stopped on teardown.

In dev mode, Vite should proxy API requests to this server.

options

default {}

returns

Plugin<PluginContext<object>>

GroPluginDenoServerOptions
#

gro_plugin_deno_server.ts view source

GroPluginDenoServerOptions

entry

Entry point TypeScript file for the Deno server.

type string

port

Port for the Deno server.

type number

host

Host for the Deno server.

type string

permissions

Deno permissions to grant.

type Array<string>

flags

Additional deno run flags (e.g. --sloppy-imports, --no-check).

type Array<string>

watch

Whether to watch for file changes and restart. Uses Deno's built-in --watch flag.

type boolean

env_file

Env file to load via Deno's --env flag. Set to null to disable env file loading.

type string | null

env

Additional environment variables to pass to the child process. Always merged with the parent process.env (for PATH, HOME, etc.). PORT, HOST, and NODE_ENV are set automatically from the plugin options.

type Record<string, string>