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

Destructuring Blows Up #147

Closed
larron opened this issue Oct 6, 2018 · 1 comment
Closed

Destructuring Blows Up #147

larron opened this issue Oct 6, 2018 · 1 comment

Comments

@larron
Copy link

larron commented Oct 6, 2018

Defining variables in this way blows up and complains about the variable process

const {
  NODE_ENV: nodeEnv,
  DEBUG: debugStr,
  PORT: port,
  APP_URL: appUrl,
  API_URL: apiUrl,
  AUTH0_DOMAIN: auth0Domain,
  AUTH0_CLIENT_ID: auth0ClientId,
  AUTH0_AUDIENCE: auth0Audience,
  CROWDSALE_API_URL: crowdsaleApiUrl,
  TOKEN_ADDRESS: tokenAddress,
  PURCHASE_ADDRESS: purchaseAddress,
  SENTRY_DSN: sentryDsn
} = process.env

The current fix is to repetively define process.env for each variable.

@mrsteele
Copy link
Owner

mrsteele commented Oct 6, 2018

Man if I had a dime....

This is a bigger problem than you might have expected. In doing extensive research on the matter (#70 (comment)), we have found that it just isn't possible to have webpack bundle your envs securely, while also supporting destructuring.

I wish it were possible as I am a huge destructure fan, but with the way we want only used envs packaged it wouldn't be feasible to support both approaches without compromising security.

I'm going to close this as a duplicate, but feel free to have a conversation over there if you wish.

@mrsteele mrsteele closed this as completed Oct 6, 2018
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

2 participants