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

inject globals from environment variables #11

Open
okwolf opened this issue Mar 14, 2019 · 0 comments
Open

inject globals from environment variables #11

okwolf opened this issue Mar 14, 2019 · 0 comments
Milestone

Comments

@okwolf
Copy link
Owner

okwolf commented Mar 14, 2019

Common use cases for this include logic that's conditionally run depending on environment and API access keys that you don't want to hardcode. We should always support NODE_ENV and possibly any variables that start with a configurable prefix like create-react-app has REACT_APP_.

To implement this, I'm thinking add a <script> that sets window.process.env = { ... } instead of trying to parse and replace the usages of the variables in scripts. It might actually be more helpful during development to see the original code and look at the values with the devtools.

@okwolf okwolf added this to the 0.5.x milestone Mar 14, 2019
@okwolf okwolf modified the milestones: 0.5.x, 0.6.x Mar 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant