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

Browserify-rails is not passing process.env.NODE_ENV to the assets? #212

Open
phuongnd08 opened this issue Dec 29, 2017 · 1 comment
Open

Comments

@phuongnd08
Copy link

phuongnd08 commented Dec 29, 2017

I'm having this in my rails application.rb:
config.browserify_rails.node_env = "production"

Inside my script which will be browserified and babelified I'm logging this:

console.warn(`My env: ${ process.env.NODE_ENV }`)

And I'm getting: My env: undefined.

Shouldn't I be getting My env: production instead?

@cymen
Copy link
Member

cymen commented Feb 7, 2018

I suggest setting NODE_ENV in the shell or via a Ruby-specific env file approach. If you want to dig into it, PRs are of course welcomed but the above is a simple solution to at least unblock you.

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