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

[SPA] allowing passing additional context to the render function #140

Open
2 tasks done
felixmosh opened this issue Mar 5, 2024 · 3 comments
Open
2 tasks done

[SPA] allowing passing additional context to the render function #140

felixmosh opened this issue Mar 5, 2024 · 3 comments

Comments

@felixmosh
Copy link
Contributor

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

Currently SPA mode doesn't allows to pass additional context to the render function.

Motivation

I have a case that I wan't to render some stuff on the html not related to the React app.

For example, render app version inside a meta tag.

Example

reply.html({
      version: env.BUILD_VERSION
});
@Shyam-Chen
Copy link
Contributor

@felixmosh
Copy link
Contributor Author

Will it work inside the HTML?
(In my case, I need it to be dynamic depending on the domain the app got served from)

@galvez
Copy link
Member

galvez commented Mar 6, 2024

As long as it's prefixed with VITE_, it will be picked up by Vite automatically.

But this feature request is very much worthwhile, I'll look into it and circle back.

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

No branches or pull requests

3 participants