Config Function
See original GitHub issueDescribe 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
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Going to close this for the sake of tracker hygiene unless another use case presents itself
@Rich-Harris valid question. I think the consistency across APIs would make it more usable, but I’m easily persuaded here. I think I’m just too old - forgot top level await was allowed.