Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime config via app.config.ts #791

Closed
aklinker1 opened this issue Jul 2, 2024 · 0 comments · Fixed by #792
Closed

Runtime config via app.config.ts #791

aklinker1 opened this issue Jul 2, 2024 · 0 comments · Fixed by #792
Labels

Comments

@aklinker1
Copy link
Collaborator

aklinker1 commented Jul 2, 2024

Feature Request

I'm working on an analytics module, and I need a way to pass config to the app at runtime, not build-time. Currently, modules only accept build config.

Nuxt does this via a <srcDir>/app.config.ts file and I want to do the same, I think it's a good pattern. However, I'm not going to support everything nuxt does. For now, I want to add:

  • Detect the file, or default to {}
  • Allow for module augmentation to add to the config type
  • From wxt/client, provide useAppConfig helper function to access the config defined in app.config.ts.

It will not support the following from nuxt:

  • Automatic type augmentation
  • Include variables from the .env file

Is your feature request related to a bug?

#790

What are the alternatives?

A clear and concise description of any alternative solutions or features you've considered.

Additional context

https://nuxt.com/docs/guide/directory-structure/app-config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant