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

consume .env file like create-react-app #2668

Closed
BLamy opened this issue Jan 6, 2018 · 1 comment
Closed

consume .env file like create-react-app #2668

BLamy opened this issue Jan 6, 2018 · 1 comment

Comments

@BLamy
Copy link

BLamy commented Jan 6, 2018

Steps to reproduce

  • start a new project with create-react-app
  • come across the need for an API Key
  • Put the .env file
REACT_APP_PLACES_API_KEY=SFlknsdpbpiSDLFYSDLKFYmfcxfbsfas_asdfs
  • Put in public/index.html
    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=%REACT_APP_PLACES_API_KEY%&libraries=places"></script>

The issue is I cannot consume this variable from .storybook/preview-head.html.

I could modify my project.json file to set them like here
https://storybook.js.org/configurations/env-vars/ but it would be nice if storybooks just played nicely with create-react-app.

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

2 participants