-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Question related to console warning #1298
Comments
I don't think that answer is correct. You need to envify React, the docs explicitly mention this.
You are logging This is my guess anyway. You can try |
Seems like I was wrong and React does include |
Thank's for your fast reply and your awesome work on redux!
I tried that. When setting the env before browserify via grunt-env to "production", the output is actually "production". When I don't use grunt-env, it is undefined (as you expected) My grunt browserify options are looking like this:
Unfortunately the warning is still there :( which is the result of this console.log in my main.js So any idea what I am doing wrong? |
My hunch is that the envify transform is not being applied as a global transform. This means envify would not transform dependency modules such as Redux. Honestly, I am not quite sure how this would be configured (the docs don't seem to help), but according to what I found in an issue, this might work:
Well, a little more research suggests that a well configured package would also be transformed by envify, just as long as |
#1301 probably fixed this. We'll push this out in 3.1. |
Yeah - you nailed it 👍 Thank you very much :) It was the |
Yes, the fix in #1301 fixes the issue for redux, but from my perspective, still a major part of libs don't have this config and aren't aware of it. |
This is an attempt to address the React's 'use production build' console warning with reference to reduxjs/redux#1298 (comment)
This is an attempt to address the React's 'use production build' console warning with reference to reduxjs/redux#1298 (comment)
This is related to #1029
We use grunt-env and grunt-browserify to bundle our build. Babel(ify) is used for transpiling.
When I create our production build, I set NODE_ENV via grunt-env to "production" . The resulting bundle gets also unglified afterwards.
The minified bundle is significantly smaller than without using grunt-env, so it seems, browserify is aware of the NODE_ENV and is building a "production" version.
Alls runs fine on our local servers. No warning in the js-console.
When building the same app via Jenkins on our staging-server (which just executes
npm install
andgrunt
), the resulting main.js leads to the warning introduced in #1029, while running in the browser.As I log the
process.env.NODE_ENV
during the grunt build, I can also see, that it is "production". The bundled js File has the exact same size, as I would build it on my local machine.So I am confused, what exactly this warning is all about. As far as I unterstand envify isn't really necessary -> http://stackoverflow.com/a/25752661/1574484
Why is the warning not on my local machine, although the same grunt build was applied?
Maybe someone could explain the backgrounds of this envify/NODE_ENV thing?
The text was updated successfully, but these errors were encountered: