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

read GATSBY_* env vars and feed to webpack #2057

Merged

Conversation

dan-weaver
Copy link
Contributor

@dan-weaver dan-weaver commented Sep 8, 2017

I'd like to have these kinds of variables in addition to the .env file. Does anyone see any problem with this method? I think it's close to what CRA does. I'll add to the readme once it's approved.

NOTE: GATSBY_* vars defined in the environment will overwrite those defined in .env. I thought that made sense. Not sure though.

also should the variables be case insensitive?

@gatsbybot
Copy link
Collaborator

gatsbybot commented Sep 8, 2017

Deploy preview ready!

Built with commit a7626ee

https://deploy-preview-2057--gatsbygram.netlify.com

@dan-weaver
Copy link
Contributor Author

Oh this relates to #1462 and #660 (comment)

@jquense
Copy link
Contributor

jquense commented Sep 8, 2017

I can't speak to whether this is good feature to add but if it is, it needs some documentation :)

@dan-weaver
Copy link
Contributor Author

dan-weaver commented Sep 8, 2017

Yep mentioned I'd update some docs after it was blessed. Sounded like @KyleAMathews wanted it (Though I didn't see that until after this). #1462 (comment)

I've been overriding my webpack config for each of the several gatsby projects I've been working with basically. Curious if others were doing that in order to get env variables of this nature in CI containers and such. Started to feel like it should be part of core like CRA.

@KyleAMathews
Copy link
Contributor

Looks solid to me! I'm on phone but will have some time in 12 hrs or so to merge and make a new release.

@KyleAMathews
Copy link
Contributor

Thanks!

@KyleAMathews KyleAMathews merged commit b39c279 into gatsbyjs:master Sep 9, 2017
@brsanthu
Copy link
Contributor

brsanthu commented Nov 8, 2017

Do you know which version of gatsby this made into?

@KyleAMathews
Copy link
Contributor

A lot of them :-) Just upgrade to the latest version and you'll have it.

@brsanthu
Copy link
Contributor

brsanthu commented Nov 8, 2017

Thx. Just browse through the release and found that it was gatsby@1.9.25 (at least that is the first release on Sep 9th).

@jlengstorf
Copy link
Contributor

Hiya @dan-weaver! 👋

This is definitely late, but on behalf of the entire Gatsby community, I wanted to say thank you for being here.

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (We’ve got t-shirts and hats, plus some socks that are really razzing our berries right now.)
  2. If you’re not already part of it, we just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. You’ll receive an email shortly asking you to confirm. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If you have questions, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again! 💪💜

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

Successfully merging this pull request may close these issues.

None yet

6 participants