svelte_config.ts

Declarations
#

5 declarations

view source

default_svelte_config
#

load_svelte_config
#

svelte_config.ts view source

({ dir, config_filename, }?: { dir?: string | undefined; config_filename?: string | undefined; }): Promise<Config | null>

Loads a SvelteKit config at dir.

__0

type { dir?: string | undefined; config_filename?: string | undefined; }
default EMPTY_OBJECT

returns

Promise<Config | null>

null if no config is found

parse_svelte_config
#

svelte_config.ts view source

({ dir_or_config, config_filename, }?: { dir_or_config?: string | Config | undefined; config_filename?: string | undefined; }): Promise<ParsedSvelteConfig>

Returns Gro-relevant properties of a SvelteKit config as a convenience wrapper around load_svelte_config. Needed because SvelteKit doesn't expose its config resolver.

__0

type { dir_or_config?: string | Config | undefined; config_filename?: string | undefined; }
default EMPTY_OBJECT

returns

Promise<ParsedSvelteConfig>

ParsedSvelteConfig
#

svelte_config.ts view source

ParsedSvelteConfig

A subset of SvelteKit's config in a form that Gro uses because SvelteKit doesn't expose its config resolver. Flattens things out to keep them simple and easy to pass around, and doesn't deal with most properties, but includes the full svelte_config. The base and assets in particular are renamed for clarity with Gro's internal systems, so these properties become first-class vocabulary inside Gro.

svelte_config

type SvelteConfig | null

alias

type Record<string, string>

base_url

type '' | `/${string}` | undefined

assets_url

type '' | `http://${string}` | `https://${string}` | undefined

assets_path

Same as the SvelteKit files.assets.

type string

lib_path

Same as the SvelteKit files.lib.

type string

routes_path

Same as the SvelteKit files.routes.

type string

env_dir

type string | undefined

private_prefix

type string | undefined

public_prefix

type string | undefined

svelte_compile_options

type CompileOptions

svelte_compile_module_options

type ModuleCompileOptions

svelte_preprocessors

type PreprocessorGroup | Array<PreprocessorGroup> | undefined

to_default_compile_module_options
#

svelte_config.ts view source

({ dev, generate, filename, rootDir, warningFilter, }: CompileOptions): ModuleCompileOptions

__0

type CompileOptions

returns

ModuleCompileOptions

Depends on
#

Imported by
#