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

Environment variables are not working #495

Closed
madushan1000 opened this issue Sep 26, 2016 · 6 comments
Closed

Environment variables are not working #495

madushan1000 opened this issue Sep 26, 2016 · 6 comments

Comments

@madushan1000
Copy link
Contributor

process.env.<VAR> type statements are not working in both the storybook static version and the dev server. Storybook version is 2.19.0.

@arunoda
Copy link
Member

arunoda commented Sep 26, 2016

I think this is working properly.
We need to use process.env.STORYBOOK_XXX in our source code.
We can't get all these values via process.env.

That's because webpack simply's define plugin simply replace a give key which is like C preprocessor.

But, we should provide a way to get it via process.env to avoid the confusion.

@arunoda arunoda added the bug label Sep 26, 2016
@thani-sh thani-sh removed the bug label Sep 27, 2016
@thani-sh
Copy link
Contributor

There's also an EnvironmentPlugin which comes bundled with webpack
https://github.com/webpack/docs/wiki/list-of-plugins#environmentplugin

@arunoda
Copy link
Member

arunoda commented Sep 27, 2016

Does it provide process.env?

@arunoda
Copy link
Member

arunoda commented Sep 30, 2016

Anyway, we can close this.

@arunoda arunoda closed this as completed Sep 30, 2016
@ilyakatz
Copy link

We can't get all these values via process.env.

Why is this the case? Is there another way for the stories code to access environmental variables?

@dzotos
Copy link

dzotos commented Sep 12, 2017

@mnmtanish worked for me. thanks!

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

5 participants