gro_plugin_server.ts

Declarations
#

6 declarations

view source

CreateOutpaths
#

gro_plugin_server
#

gro_plugin_server.ts view source

({ entry_points, dir, outpaths, env_files, ambient_env, svelte_config, target, esbuild_build_options, rebuild_throttle_delay, cli_command, run, }?: GroPluginServerOptions): Plugin<PluginContext<object>>

__0

default {}

returns

Plugin<PluginContext<object>>

GroPluginServerOptions
#

gro_plugin_server.ts view source

GroPluginServerOptions

entry_points

same as esbuild's entryPoints

type Array<string>

dir

type string

outpaths

Returns the Outpaths given a dev param. Decoupling this from plugin creation allows it to be created generically, so the build and dev tasks can be the source of truth for dev.

env_files

type Array<string>

ambient_env

type Record<string, string>

svelte_config

type SvelteConfig

target

type string

esbuild_build_options

Optionally map the esbuild options.

type (base_options: esbuild.BuildOptions) => esbuild.BuildOptions

rebuild_throttle_delay

Milliseconds to throttle rebuilds. Should be longer than it takes to build to avoid backpressure.

type number

cli_command

The CLI command to run the server, like 'node' or 'bun' or 'deno'. Receives the path to the server js file as its argument.

type string

run

Whether to run the server or not after building.

type boolean

has_server
#

gro_plugin_server.ts view source

(path?: PathId): Promise<Result<object, { message: string; }>>

path

type PathId
default SERVER_SOURCE_ID

returns

Promise<Result<object, { message: string; }>>

Outpaths
#

SERVER_SOURCE_ID
#

Depends on
#

Imported by
#