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.

view source

Declarations
#

2 declarations

gro_plugin_deno_server
#

gro_plugin_deno_server.ts view source

(options?: GroPluginDenoServerOptions): Plugin<PluginContext<object>> import {gro_plugin_deno_server} from '@fuzdev/gro/gro_plugin_deno_server.js';

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 import type {GroPluginDenoServerOptions} from '@fuzdev/gro/gro_plugin_deno_server.js';

entry?

Entry point TypeScript file for the Deno server.

type string

default 'src/lib/backend/server.ts'

port?

Port for the Deno server.

type number

default 4041

host?

Host for the Deno server.

type string

default 'localhost'

permissions?

Deno permissions to grant.

type string[]

default ['--allow-net', '--allow-read', '--allow-env']

flags?

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

type string[]

default []

watch?

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

type boolean

default true in `dev`

env_file?

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

type string | null

default '.env.development'

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>

default {}

Depends on
#