question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Rich-Harriscommented, Mar 5, 2022

Going to close this for the sake of tracker hygiene unless another use case presents itself

0reactions
Crisfolecommented, Jan 31, 2022

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Config Function - Thinkster.io
So let's try manipulating $route in our controller. Comment out what's in our config function, and move the route declaration to our controller....
Read more >
Configure your environment | Cloud Functions for Firebase
Set environment configuration with the CLI​​ To store environment data, you can use the firebase functions:config:set command in the Firebase CLI. Each key...
Read more >
Configuration - Laravel - The PHP Framework For Web Artisans
You may easily access your configuration values using the global config function from anywhere in your application. The configuration values may be accessed ......
Read more >
Function Configuration module - funconf - PythonHosted.org
The Config class is the root class container for all of the configuration sections. It implements the MutableMapping type which allows it to...
Read more >
Configuration Types - webpack
config.js between development and production builds. There are multiple ways to do that. One option is to export a function from your webpack...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found