Skip to content

Config Function #3077

@Crisfole

Description

@Crisfole

Describe the problem

Much like vite, some configuration options for svelte kit are dependent on the mode you're running in. In particular the hostHeader which is rarely wanted when you're running locally (some docker-configs excepted). Currently we have to rely on environment variables which are OK, but less smooth a path than vite's strategy of accepting either a function or a config object.

Describe the proposed solution

I'd love for svelte to accept either a config object, or a function that receives some environment information and returns the config object. I brainlessly spent about an hour this morning confusing the Vite and svelte configurations and assuming I could use a function for both. The hour wasted was my fault, but it did reveal a feature that would be simple and nice.

Alternatives considered

Environment variables.

Importance

would make my life easier

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions