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

Accessing NODE_ENV in js files. #44

Open
Huespal opened this issue May 18, 2018 · 3 comments
Open

Accessing NODE_ENV in js files. #44

Huespal opened this issue May 18, 2018 · 3 comments

Comments

@Huespal
Copy link

Huespal commented May 18, 2018

Is there a way to access process.env.NODE_ENV values in project JS files?
I mean, something similar as I do in webpack. I can access to process.env.NODE_ENV from a js file's project to do some code or another depending on the environment.
For the moment I can only access environmental variable in grunt tasks.
Thanks.

@uullrich
Copy link

Hello,
I have the same need to include a debug mechanisms in my dev build. In particular I like to include Redux Dev Tools in my dev build and remove it from my prod build

Thank you :-)

@juan88
Copy link

juan88 commented Mar 30, 2020

@Huespal how can you access those variables from your Gruntfile.js? I'm trying to load them from a .env file but I cannot read them in my Gruntfile. Thx!

@stefanomalinconico
Copy link

@Huespal how can you access those variables from your Gruntfile.js? I'm trying to load them from a .env file but I cannot read them in my Gruntfile. Thx!

Did you discover how to do this? thnx

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

4 participants